@marko/runtime-tags 0.3.49 → 0.3.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/types.d.ts +0 -1
- package/dist/debug/dom.js +4 -12
- package/dist/debug/dom.mjs +4 -12
- package/dist/dom/renderer.d.ts +3 -3
- package/dist/dom/template.d.ts +1 -1
- package/dist/dom/walker.d.ts +0 -1
- package/dist/dom.js +17 -21
- package/dist/dom.mjs +17 -21
- package/package.json +1 -1
- package/tag-types/script.d.marko +1 -1
package/dist/common/types.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export interface BranchScope extends Scope {
|
|
|
5
5
|
___startNode: ChildNode;
|
|
6
6
|
___endNode: ChildNode;
|
|
7
7
|
___parentBranch: BranchScope | undefined;
|
|
8
|
-
___branchDepth: number;
|
|
9
8
|
___destroyed: 1 | undefined;
|
|
10
9
|
___abortScopes: Set<Scope> | undefined;
|
|
11
10
|
___branchScopes: Set<BranchScope> | undefined;
|
package/dist/debug/dom.js
CHANGED
|
@@ -1333,11 +1333,6 @@ function longestIncreasingSubsequence(a) {
|
|
|
1333
1333
|
|
|
1334
1334
|
// src/dom/walker.ts
|
|
1335
1335
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
|
1336
|
-
function trimWalkString(walkString) {
|
|
1337
|
-
let end = walkString.length;
|
|
1338
|
-
while (walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */) ;
|
|
1339
|
-
return walkString.slice(0, end + 1);
|
|
1340
|
-
}
|
|
1341
1336
|
function walk(startNode, walkCodes, branch) {
|
|
1342
1337
|
walker.currentNode = startNode;
|
|
1343
1338
|
walkInternal(0, walkCodes, branch);
|
|
@@ -1432,11 +1427,8 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
|
1432
1427
|
branch._ = renderer.___owner || parentScope;
|
|
1433
1428
|
branch.___closestBranch = branch;
|
|
1434
1429
|
if (parentBranch) {
|
|
1435
|
-
branch.___branchDepth = parentBranch.___branchDepth + 1;
|
|
1436
1430
|
branch.___parentBranch = parentBranch;
|
|
1437
1431
|
(parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(branch);
|
|
1438
|
-
} else {
|
|
1439
|
-
branch.___branchDepth = 1;
|
|
1440
1432
|
}
|
|
1441
1433
|
if (true) {
|
|
1442
1434
|
branch.___renderer = renderer;
|
|
@@ -1447,9 +1439,9 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
|
1447
1439
|
);
|
|
1448
1440
|
return branch;
|
|
1449
1441
|
}
|
|
1450
|
-
function createContent(id, template,
|
|
1442
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
|
1443
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
|
1451
1444
|
let args;
|
|
1452
|
-
const walks = rawWalks ? /* @__PURE__ */ trimWalkString(rawWalks) : "";
|
|
1453
1445
|
const init2 = template ? (branch, ns) => {
|
|
1454
1446
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
|
1455
1447
|
template,
|
|
@@ -2002,11 +1994,11 @@ var compat = {
|
|
|
2002
1994
|
};
|
|
2003
1995
|
|
|
2004
1996
|
// src/dom/template.ts
|
|
2005
|
-
var createTemplate = (id, template,
|
|
1997
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
|
2006
1998
|
const renderer = createContent(
|
|
2007
1999
|
id,
|
|
2008
2000
|
template,
|
|
2009
|
-
|
|
2001
|
+
walks,
|
|
2010
2002
|
setup,
|
|
2011
2003
|
inputSignal && (() => inputSignal)
|
|
2012
2004
|
)();
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1248,11 +1248,6 @@ function longestIncreasingSubsequence(a) {
|
|
|
1248
1248
|
|
|
1249
1249
|
// src/dom/walker.ts
|
|
1250
1250
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
|
1251
|
-
function trimWalkString(walkString) {
|
|
1252
|
-
let end = walkString.length;
|
|
1253
|
-
while (walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */) ;
|
|
1254
|
-
return walkString.slice(0, end + 1);
|
|
1255
|
-
}
|
|
1256
1251
|
function walk(startNode, walkCodes, branch) {
|
|
1257
1252
|
walker.currentNode = startNode;
|
|
1258
1253
|
walkInternal(0, walkCodes, branch);
|
|
@@ -1347,11 +1342,8 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
|
1347
1342
|
branch._ = renderer.___owner || parentScope;
|
|
1348
1343
|
branch.___closestBranch = branch;
|
|
1349
1344
|
if (parentBranch) {
|
|
1350
|
-
branch.___branchDepth = parentBranch.___branchDepth + 1;
|
|
1351
1345
|
branch.___parentBranch = parentBranch;
|
|
1352
1346
|
(parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(branch);
|
|
1353
|
-
} else {
|
|
1354
|
-
branch.___branchDepth = 1;
|
|
1355
1347
|
}
|
|
1356
1348
|
if (true) {
|
|
1357
1349
|
branch.___renderer = renderer;
|
|
@@ -1362,9 +1354,9 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
|
1362
1354
|
);
|
|
1363
1355
|
return branch;
|
|
1364
1356
|
}
|
|
1365
|
-
function createContent(id, template,
|
|
1357
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
|
1358
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
|
1366
1359
|
let args;
|
|
1367
|
-
const walks = rawWalks ? /* @__PURE__ */ trimWalkString(rawWalks) : "";
|
|
1368
1360
|
const init2 = template ? (branch, ns) => {
|
|
1369
1361
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
|
1370
1362
|
template,
|
|
@@ -1917,11 +1909,11 @@ var compat = {
|
|
|
1917
1909
|
};
|
|
1918
1910
|
|
|
1919
1911
|
// src/dom/template.ts
|
|
1920
|
-
var createTemplate = (id, template,
|
|
1912
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
|
1921
1913
|
const renderer = createContent(
|
|
1922
1914
|
id,
|
|
1923
1915
|
template,
|
|
1924
|
-
|
|
1916
|
+
walks,
|
|
1925
1917
|
setup,
|
|
1926
1918
|
inputSignal && (() => inputSignal)
|
|
1927
1919
|
)();
|
package/dist/dom/renderer.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type Renderer = {
|
|
|
10
10
|
type SetupFn = (scope: Scope) => void;
|
|
11
11
|
export declare function createBranchWithTagNameOrRenderer($global: Scope["$global"], tagNameOrRenderer: Renderer | string, parentScope: Scope, parentNode: ParentNode): BranchScope;
|
|
12
12
|
export declare function createBranch($global: Scope["$global"], renderer: Renderer | string, parentScope: Scope | undefined, parentNode: ParentNode): BranchScope;
|
|
13
|
-
export declare function createContent(id: string, template
|
|
14
|
-
export declare function registerContent(id: string, template
|
|
15
|
-
export declare function createRenderer(template
|
|
13
|
+
export declare function createContent(id: string, template: string | 0, walks?: string | 0, setup?: SetupFn | 0, getArgs?: (() => Signal<unknown>) | 0, dynamicScopesAccessor?: Accessor): (owner?: Scope) => Renderer;
|
|
14
|
+
export declare function registerContent(id: string, template: string | 0, walks?: string | 0, setup?: SetupFn | 0, getArgs?: (() => Signal<unknown>) | 0, dynamicScopesAccessor?: Accessor): (owner?: Scope) => Renderer;
|
|
15
|
+
export declare function createRenderer(template: string | 0, walks?: string | 0, setup?: SetupFn | 0, getArgs?: (() => Signal<unknown>) | 0): Renderer;
|
|
16
16
|
export {};
|
package/dist/dom/template.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Scope, Template } from "../common/types";
|
|
2
2
|
import type { Signal } from "./signals";
|
|
3
|
-
export declare const createTemplate: (id: string, template
|
|
3
|
+
export declare const createTemplate: (id: string, template: string | 0, walks?: string | 0, setup?: ((scope: Scope) => void) | 0, inputSignal?: Signal<unknown>) => Template;
|
package/dist/dom/walker.d.ts
CHANGED
package/dist/dom.js
CHANGED
|
@@ -201,17 +201,17 @@ var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
|
|
201
201
|
var registeredValues = {}, Render = class {
|
|
202
202
|
p = [];
|
|
203
203
|
q = {};
|
|
204
|
-
|
|
204
|
+
B = {
|
|
205
205
|
_: registeredValues
|
|
206
206
|
};
|
|
207
207
|
constructor(renders, runtimeId, renderId) {
|
|
208
|
-
this.
|
|
208
|
+
this.C = renders, this.D = runtimeId, this.s = renderId, this.t = renders[renderId], this.u();
|
|
209
209
|
}
|
|
210
210
|
w() {
|
|
211
211
|
this.t.w(), this.u();
|
|
212
212
|
}
|
|
213
213
|
u() {
|
|
214
|
-
let data2 = this.t, serializeContext = this.
|
|
214
|
+
let data2 = this.t, serializeContext = this.B, scopeLookup = this.q, visits = data2.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
|
|
215
215
|
if (visits.length) {
|
|
216
216
|
let commentPrefixLen = data2.i.length, closestBranchMarkers = /* @__PURE__ */ new Map(), visitNodes = new Set(visits), lastEndNode;
|
|
217
217
|
data2.v = [];
|
|
@@ -263,7 +263,7 @@ var registeredValues = {}, Render = class {
|
|
|
263
263
|
let resumeData = resumes[i++];
|
|
264
264
|
if (typeof resumeData == "function") {
|
|
265
265
|
let scopes = resumeData(serializeContext), { $global } = scopeLookup;
|
|
266
|
-
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.
|
|
266
|
+
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.D, $global.renderId = this.s, $global.g = 1e6);
|
|
267
267
|
for (let scopeId in scopes)
|
|
268
268
|
if (scopeId !== "$") {
|
|
269
269
|
let scope = scopes[scopeId], prevScope = scopeLookup[scopeId];
|
|
@@ -277,7 +277,7 @@ var registeredValues = {}, Render = class {
|
|
|
277
277
|
scope.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch));
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
} else i === len || typeof resumes[i] != "string" ? delete this.
|
|
280
|
+
} else i === len || typeof resumes[i] != "string" ? delete this.C[this.s] : registeredValues[resumes[i++]](
|
|
281
281
|
scopeLookup[resumeData],
|
|
282
282
|
scopeLookup[resumeData]
|
|
283
283
|
);
|
|
@@ -732,7 +732,7 @@ function destroyBranch(branch) {
|
|
|
732
732
|
branch.x?.n?.delete(branch), destroyNestedBranches(branch);
|
|
733
733
|
}
|
|
734
734
|
function destroyNestedBranches(branch) {
|
|
735
|
-
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.
|
|
735
|
+
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.E?.forEach((scope) => {
|
|
736
736
|
for (let id in scope.k)
|
|
737
737
|
scope.k[id]?.abort();
|
|
738
738
|
});
|
|
@@ -759,7 +759,7 @@ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.d) {
|
|
|
759
759
|
let render = {
|
|
760
760
|
j: key,
|
|
761
761
|
A: scope,
|
|
762
|
-
|
|
762
|
+
F: signal,
|
|
763
763
|
z: value2
|
|
764
764
|
}, i = pendingRenders.push(render) - 1;
|
|
765
765
|
for (; i; ) {
|
|
@@ -812,7 +812,7 @@ function runRenders() {
|
|
|
812
812
|
}
|
|
813
813
|
pendingRenders[i] = item;
|
|
814
814
|
}
|
|
815
|
-
render.A.c?.y || render.
|
|
815
|
+
render.A.c?.y || render.F(render.A, render.z);
|
|
816
816
|
}
|
|
817
817
|
finishPendingScopes();
|
|
818
818
|
}
|
|
@@ -823,7 +823,7 @@ function resetAbortSignal(scope, id) {
|
|
|
823
823
|
ctrl && (queueEffect(ctrl, abort), scope.k[id] = void 0);
|
|
824
824
|
}
|
|
825
825
|
function getAbortSignal(scope, id) {
|
|
826
|
-
return scope.c && (scope.c.
|
|
826
|
+
return scope.c && (scope.c.E ||= /* @__PURE__ */ new Set()).add(scope), ((scope.k ||= {})[id] ||= new AbortController()).signal;
|
|
827
827
|
}
|
|
828
828
|
function abort(ctrl) {
|
|
829
829
|
ctrl.abort();
|
|
@@ -909,11 +909,6 @@ function longestIncreasingSubsequence(a) {
|
|
|
909
909
|
|
|
910
910
|
// src/dom/walker.ts
|
|
911
911
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
|
912
|
-
function trimWalkString(walkString) {
|
|
913
|
-
let end = walkString.length;
|
|
914
|
-
for (; walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */; ) ;
|
|
915
|
-
return walkString.slice(0, end + 1);
|
|
916
|
-
}
|
|
917
912
|
function walk(startNode, walkCodes, branch) {
|
|
918
913
|
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
|
919
914
|
}
|
|
@@ -966,13 +961,14 @@ function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentSco
|
|
|
966
961
|
}
|
|
967
962
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
968
963
|
let branch = createScope($global), parentBranch = parentScope?.c;
|
|
969
|
-
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch
|
|
964
|
+
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch)), renderer.o?.(
|
|
970
965
|
branch,
|
|
971
966
|
parentNode.namespaceURI
|
|
972
967
|
), branch;
|
|
973
968
|
}
|
|
974
|
-
function createContent(id, template,
|
|
975
|
-
|
|
969
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
|
970
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
|
971
|
+
let args, init2 = template ? (branch, ns) => {
|
|
976
972
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
|
977
973
|
template,
|
|
978
974
|
ns
|
|
@@ -1097,7 +1093,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
|
1097
1093
|
if (subscribers)
|
|
1098
1094
|
for (let subscriber of subscribers)
|
|
1099
1095
|
subscriber.h || queueRender(subscriber, childSignal, -1);
|
|
1100
|
-
}, subscribe = ownerSignal.
|
|
1096
|
+
}, subscribe = ownerSignal.G = (scope) => subscribeToScopeSet(
|
|
1101
1097
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
|
1102
1098
|
subscribersAccessor,
|
|
1103
1099
|
scope
|
|
@@ -1108,7 +1104,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
|
1108
1104
|
}
|
|
1109
1105
|
function registerDynamicClosure(registryId, valueAccessor, fn, getOwnerScope) {
|
|
1110
1106
|
let signal = dynamicClosure(valueAccessor, fn, getOwnerScope);
|
|
1111
|
-
return register(registryId, signal.
|
|
1107
|
+
return register(registryId, signal.G), signal;
|
|
1112
1108
|
}
|
|
1113
1109
|
function closure(valueAccessor, fn, getOwnerScope) {
|
|
1114
1110
|
return (scope) => {
|
|
@@ -1333,11 +1329,11 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1333
1329
|
};
|
|
1334
1330
|
|
|
1335
1331
|
// src/dom/template.ts
|
|
1336
|
-
var createTemplate = (id, template,
|
|
1332
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
|
1337
1333
|
let renderer = createContent(
|
|
1338
1334
|
id,
|
|
1339
1335
|
template,
|
|
1340
|
-
|
|
1336
|
+
walks,
|
|
1341
1337
|
setup,
|
|
1342
1338
|
inputSignal && (() => inputSignal)
|
|
1343
1339
|
)();
|
package/dist/dom.mjs
CHANGED
|
@@ -119,17 +119,17 @@ var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
|
|
119
119
|
var registeredValues = {}, Render = class {
|
|
120
120
|
p = [];
|
|
121
121
|
q = {};
|
|
122
|
-
|
|
122
|
+
B = {
|
|
123
123
|
_: registeredValues
|
|
124
124
|
};
|
|
125
125
|
constructor(renders, runtimeId, renderId) {
|
|
126
|
-
this.
|
|
126
|
+
this.C = renders, this.D = runtimeId, this.s = renderId, this.t = renders[renderId], this.u();
|
|
127
127
|
}
|
|
128
128
|
w() {
|
|
129
129
|
this.t.w(), this.u();
|
|
130
130
|
}
|
|
131
131
|
u() {
|
|
132
|
-
let data2 = this.t, serializeContext = this.
|
|
132
|
+
let data2 = this.t, serializeContext = this.B, scopeLookup = this.q, visits = data2.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
|
|
133
133
|
if (visits.length) {
|
|
134
134
|
let commentPrefixLen = data2.i.length, closestBranchMarkers = /* @__PURE__ */ new Map(), visitNodes = new Set(visits), lastEndNode;
|
|
135
135
|
data2.v = [];
|
|
@@ -181,7 +181,7 @@ var registeredValues = {}, Render = class {
|
|
|
181
181
|
let resumeData = resumes[i++];
|
|
182
182
|
if (typeof resumeData == "function") {
|
|
183
183
|
let scopes = resumeData(serializeContext), { $global } = scopeLookup;
|
|
184
|
-
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.
|
|
184
|
+
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.D, $global.renderId = this.s, $global.g = 1e6);
|
|
185
185
|
for (let scopeId in scopes)
|
|
186
186
|
if (scopeId !== "$") {
|
|
187
187
|
let scope = scopes[scopeId], prevScope = scopeLookup[scopeId];
|
|
@@ -195,7 +195,7 @@ var registeredValues = {}, Render = class {
|
|
|
195
195
|
scope.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch));
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
} else i === len || typeof resumes[i] != "string" ? delete this.
|
|
198
|
+
} else i === len || typeof resumes[i] != "string" ? delete this.C[this.s] : registeredValues[resumes[i++]](
|
|
199
199
|
scopeLookup[resumeData],
|
|
200
200
|
scopeLookup[resumeData]
|
|
201
201
|
);
|
|
@@ -650,7 +650,7 @@ function destroyBranch(branch) {
|
|
|
650
650
|
branch.x?.n?.delete(branch), destroyNestedBranches(branch);
|
|
651
651
|
}
|
|
652
652
|
function destroyNestedBranches(branch) {
|
|
653
|
-
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.
|
|
653
|
+
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.E?.forEach((scope) => {
|
|
654
654
|
for (let id in scope.k)
|
|
655
655
|
scope.k[id]?.abort();
|
|
656
656
|
});
|
|
@@ -677,7 +677,7 @@ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.d) {
|
|
|
677
677
|
let render = {
|
|
678
678
|
j: key,
|
|
679
679
|
A: scope,
|
|
680
|
-
|
|
680
|
+
F: signal,
|
|
681
681
|
z: value2
|
|
682
682
|
}, i = pendingRenders.push(render) - 1;
|
|
683
683
|
for (; i; ) {
|
|
@@ -730,7 +730,7 @@ function runRenders() {
|
|
|
730
730
|
}
|
|
731
731
|
pendingRenders[i] = item;
|
|
732
732
|
}
|
|
733
|
-
render.A.c?.y || render.
|
|
733
|
+
render.A.c?.y || render.F(render.A, render.z);
|
|
734
734
|
}
|
|
735
735
|
finishPendingScopes();
|
|
736
736
|
}
|
|
@@ -741,7 +741,7 @@ function resetAbortSignal(scope, id) {
|
|
|
741
741
|
ctrl && (queueEffect(ctrl, abort), scope.k[id] = void 0);
|
|
742
742
|
}
|
|
743
743
|
function getAbortSignal(scope, id) {
|
|
744
|
-
return scope.c && (scope.c.
|
|
744
|
+
return scope.c && (scope.c.E ||= /* @__PURE__ */ new Set()).add(scope), ((scope.k ||= {})[id] ||= new AbortController()).signal;
|
|
745
745
|
}
|
|
746
746
|
function abort(ctrl) {
|
|
747
747
|
ctrl.abort();
|
|
@@ -827,11 +827,6 @@ function longestIncreasingSubsequence(a) {
|
|
|
827
827
|
|
|
828
828
|
// src/dom/walker.ts
|
|
829
829
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
|
830
|
-
function trimWalkString(walkString) {
|
|
831
|
-
let end = walkString.length;
|
|
832
|
-
for (; walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */; ) ;
|
|
833
|
-
return walkString.slice(0, end + 1);
|
|
834
|
-
}
|
|
835
830
|
function walk(startNode, walkCodes, branch) {
|
|
836
831
|
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
|
837
832
|
}
|
|
@@ -884,13 +879,14 @@ function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentSco
|
|
|
884
879
|
}
|
|
885
880
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
886
881
|
let branch = createScope($global), parentBranch = parentScope?.c;
|
|
887
|
-
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch
|
|
882
|
+
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch)), renderer.o?.(
|
|
888
883
|
branch,
|
|
889
884
|
parentNode.namespaceURI
|
|
890
885
|
), branch;
|
|
891
886
|
}
|
|
892
|
-
function createContent(id, template,
|
|
893
|
-
|
|
887
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
|
888
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
|
889
|
+
let args, init2 = template ? (branch, ns) => {
|
|
894
890
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
|
895
891
|
template,
|
|
896
892
|
ns
|
|
@@ -1015,7 +1011,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
|
1015
1011
|
if (subscribers)
|
|
1016
1012
|
for (let subscriber of subscribers)
|
|
1017
1013
|
subscriber.h || queueRender(subscriber, childSignal, -1);
|
|
1018
|
-
}, subscribe = ownerSignal.
|
|
1014
|
+
}, subscribe = ownerSignal.G = (scope) => subscribeToScopeSet(
|
|
1019
1015
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
|
1020
1016
|
subscribersAccessor,
|
|
1021
1017
|
scope
|
|
@@ -1026,7 +1022,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
|
1026
1022
|
}
|
|
1027
1023
|
function registerDynamicClosure(registryId, valueAccessor, fn, getOwnerScope) {
|
|
1028
1024
|
let signal = dynamicClosure(valueAccessor, fn, getOwnerScope);
|
|
1029
|
-
return register(registryId, signal.
|
|
1025
|
+
return register(registryId, signal.G), signal;
|
|
1030
1026
|
}
|
|
1031
1027
|
function closure(valueAccessor, fn, getOwnerScope) {
|
|
1032
1028
|
return (scope) => {
|
|
@@ -1251,11 +1247,11 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
|
1251
1247
|
};
|
|
1252
1248
|
|
|
1253
1249
|
// src/dom/template.ts
|
|
1254
|
-
var createTemplate = (id, template,
|
|
1250
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
|
1255
1251
|
let renderer = createContent(
|
|
1256
1252
|
id,
|
|
1257
1253
|
template,
|
|
1258
|
-
|
|
1254
|
+
walks,
|
|
1259
1255
|
setup,
|
|
1260
1256
|
inputSignal && (() => inputSignal)
|
|
1261
1257
|
)();
|
package/package.json
CHANGED
package/tag-types/script.d.marko
CHANGED