Skip to content

Commit

Permalink
bump build
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenDE committed Nov 13, 2024
1 parent af851c4 commit 71d6c44
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 9 deletions.
25 changes: 25 additions & 0 deletions priv/static/phoenix_live_view.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.cjs.js.map

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions priv/static/phoenix_live_view.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.esm.js.map

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions priv/static/phoenix_live_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ var LiveView = (() => {
var PHX_UPDATE = "update";
var PHX_STREAM = "stream";
var PHX_STREAM_REF = "data-phx-stream";
var PHX_PORTAL = "portal";
var PHX_PORTAL_REF = "data-phx-portal";
var PHX_KEY = "key";
var PHX_PRIVATE = "phxPrivate";
var PHX_AUTO_RECOVER = "auto-recover";
Expand Down Expand Up @@ -2304,6 +2306,7 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
this.cidPatch = isCid(this.targetCID);
this.pendingRemoves = [];
this.phxRemove = this.liveSocket.binding("remove");
this.portal = this.liveSocket.binding(PHX_PORTAL);
this.targetContainer = this.isCIDPatch() ? this.targetCIDContainer(html) : container;
this.callbacks = {
beforeadded: [],
Expand Down Expand Up @@ -2373,6 +2376,15 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
addChild: (parent, child) => {
let { ref, streamAt } = this.getStreamInsert(child);
if (ref === void 0) {
if (child.getAttribute && child.getAttribute(PHX_PORTAL_REF) !== null) {
const targetId = child.getAttribute(PHX_PORTAL_REF);
const portalTarget = dom_default.byId(targetId);
child.removeAttribute(this.portal);
if (portalTarget.contains(child)) {
return;
}
return portalTarget.appendChild(child);
}
return parent.appendChild(child);
}
this.setStreamRef(child, ref);
Expand Down Expand Up @@ -2502,6 +2514,19 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
return false;
}
dom_default.copyPrivates(toEl, fromEl);
if (fromEl.hasAttribute(this.portal) || toEl.hasAttribute(this.portal)) {
const targetId = toEl.getAttribute(this.portal);
const portalTarget = dom_default.byId(targetId);
toEl.removeAttribute(this.portal);
toEl.setAttribute(PHX_PORTAL_REF, targetId);
const existing = document.getElementById(fromEl.id);
if (existing && portalTarget.contains(existing)) {
return existing;
} else {
portalTarget.appendChild(fromEl);
return fromEl;
}
}
if (isFocusedFormEl && fromEl.type !== "hidden" && !focusedSelectChanged) {
this.trackBefore("updated", fromEl, toEl);
dom_default.mergeFocusedInput(fromEl, toEl);
Expand Down
Loading

0 comments on commit 71d6c44

Please sign in to comment.