@jinntec/fore 3.1.1 → 3.1.2
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/fore-dev.js +9 -11
- package/dist/fore.js +8 -10
- package/package.json +1 -1
- package/src/fx-fore.js +8 -8
- package/src/fx-model.js +21 -20
package/dist/fore-dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Version: 3.1.
|
|
1
|
+
/* Version: 3.1.2 - May 27, 2026 14:39:35 */
|
|
2
2
|
function t$2(t, s, r, i) {
|
|
3
3
|
const n = {
|
|
4
4
|
op: s,
|
|
@@ -21574,10 +21574,8 @@ class FxModel extends HTMLElement {
|
|
|
21574
21574
|
const instance = model.getInstance(instanceId);
|
|
21575
21575
|
const fore = model.formElement;
|
|
21576
21576
|
if (fore?.createNodes && (node === null || node === undefined)) {
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
model.registerModelItem(mi);
|
|
21580
|
-
return mi;
|
|
21577
|
+
// Do not create the model item. It may be exchanged later when create-nodes actually made the node
|
|
21578
|
+
return null;
|
|
21581
21579
|
}
|
|
21582
21580
|
if (node === null || node === undefined) return null;
|
|
21583
21581
|
let targetNode = Array.isArray(node) ? node[0] : node;
|
|
@@ -25481,7 +25479,7 @@ class FxFore extends HTMLElement {
|
|
|
25481
25479
|
this._createRepeatsFromAttributes();
|
|
25482
25480
|
this.inited = true;
|
|
25483
25481
|
};
|
|
25484
|
-
this.version = 'Version: 3.1.
|
|
25482
|
+
this.version = 'Version: 3.1.2 - built on May 27, 2026 14:39:35';
|
|
25485
25483
|
|
|
25486
25484
|
/**
|
|
25487
25485
|
* @type {import('./fx-model.js').FxModel}
|
|
@@ -27114,6 +27112,11 @@ class FxFore extends HTMLElement {
|
|
|
27114
27112
|
continue;
|
|
27115
27113
|
}
|
|
27116
27114
|
const parsed = parseName(token);
|
|
27115
|
+
if (!isValidName(parsed.localName)) {
|
|
27116
|
+
// This did not result in a valid name. Stop.
|
|
27117
|
+
console.warn(`Creating node for the XPath ${xpath} failed because the part ${parsed.localName} is not a valid Name.`);
|
|
27118
|
+
return;
|
|
27119
|
+
}
|
|
27117
27120
|
if (parsed.isAttribute) {
|
|
27118
27121
|
if (!current) {
|
|
27119
27122
|
const attr = ownerDoc.createAttribute(parsed.localName);
|
|
@@ -27122,11 +27125,6 @@ class FxFore extends HTMLElement {
|
|
|
27122
27125
|
current.setAttribute(parsed.localName, '');
|
|
27123
27126
|
continue;
|
|
27124
27127
|
}
|
|
27125
|
-
if (!isValidName(parsed.localName)) {
|
|
27126
|
-
// This did not result in a valid name. Stop.
|
|
27127
|
-
console.warn(`Creating node for the XPath ${xpath} failed because the part ${parsed.localName} is not a valid Name.`);
|
|
27128
|
-
return;
|
|
27129
|
-
}
|
|
27130
27128
|
const element = parsed.namespaceURI ? ownerDoc.createElementNS(parsed.namespaceURI, parsed.localName) : ownerDoc.createElement(parsed.localName);
|
|
27131
27129
|
for (const predicate of predicates) {
|
|
27132
27130
|
const attrName = predicate.name.includes(':') ? predicate.name.split(':')[1] : predicate.name;
|
package/dist/fore.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Version: 3.1.
|
|
1
|
+
/* Version: 3.1.2 - May 27, 2026 14:39:34 */
|
|
2
2
|
function t$2(t, s, r, i) {
|
|
3
3
|
const n = {
|
|
4
4
|
op: s,
|
|
@@ -21553,10 +21553,8 @@ class FxModel extends HTMLElement {
|
|
|
21553
21553
|
const instance = model.getInstance(instanceId);
|
|
21554
21554
|
const fore = model.formElement;
|
|
21555
21555
|
if (fore?.createNodes && (node === null || node === undefined)) {
|
|
21556
|
-
|
|
21557
|
-
|
|
21558
|
-
model.registerModelItem(mi);
|
|
21559
|
-
return mi;
|
|
21556
|
+
// Do not create the model item. It may be exchanged later when create-nodes actually made the node
|
|
21557
|
+
return null;
|
|
21560
21558
|
}
|
|
21561
21559
|
if (node === null || node === undefined) return null;
|
|
21562
21560
|
let targetNode = Array.isArray(node) ? node[0] : node;
|
|
@@ -25427,7 +25425,7 @@ class FxFore extends HTMLElement {
|
|
|
25427
25425
|
this._createRepeatsFromAttributes();
|
|
25428
25426
|
this.inited = true;
|
|
25429
25427
|
};
|
|
25430
|
-
this.version = 'Version: 3.1.
|
|
25428
|
+
this.version = 'Version: 3.1.2 - built on May 27, 2026 14:39:34';
|
|
25431
25429
|
|
|
25432
25430
|
/**
|
|
25433
25431
|
* @type {import('./fx-model.js').FxModel}
|
|
@@ -27043,6 +27041,10 @@ class FxFore extends HTMLElement {
|
|
|
27043
27041
|
continue;
|
|
27044
27042
|
}
|
|
27045
27043
|
const parsed = parseName(token);
|
|
27044
|
+
if (!isValidName(parsed.localName)) {
|
|
27045
|
+
// This did not result in a valid name. Stop.
|
|
27046
|
+
return;
|
|
27047
|
+
}
|
|
27046
27048
|
if (parsed.isAttribute) {
|
|
27047
27049
|
if (!current) {
|
|
27048
27050
|
const attr = ownerDoc.createAttribute(parsed.localName);
|
|
@@ -27051,10 +27053,6 @@ class FxFore extends HTMLElement {
|
|
|
27051
27053
|
current.setAttribute(parsed.localName, '');
|
|
27052
27054
|
continue;
|
|
27053
27055
|
}
|
|
27054
|
-
if (!isValidName(parsed.localName)) {
|
|
27055
|
-
// This did not result in a valid name. Stop.
|
|
27056
|
-
return;
|
|
27057
|
-
}
|
|
27058
27056
|
const element = parsed.namespaceURI ? ownerDoc.createElementNS(parsed.namespaceURI, parsed.localName) : ownerDoc.createElement(parsed.localName);
|
|
27059
27057
|
for (const predicate of predicates) {
|
|
27060
27058
|
const attrName = predicate.name.includes(':') ? predicate.name.split(':')[1] : predicate.name;
|
package/package.json
CHANGED
package/src/fx-fore.js
CHANGED
|
@@ -2016,6 +2016,14 @@ export class FxFore extends HTMLElement {
|
|
|
2016
2016
|
|
|
2017
2017
|
const parsed = parseName(token);
|
|
2018
2018
|
|
|
2019
|
+
if (!isValidName(parsed.localName)) {
|
|
2020
|
+
// This did not result in a valid name. Stop.
|
|
2021
|
+
console.warn(
|
|
2022
|
+
`Creating node for the XPath ${xpath} failed because the part ${parsed.localName} is not a valid Name.`,
|
|
2023
|
+
);
|
|
2024
|
+
return;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2019
2027
|
if (parsed.isAttribute) {
|
|
2020
2028
|
if (!current) {
|
|
2021
2029
|
const attr = ownerDoc.createAttribute(parsed.localName);
|
|
@@ -2025,14 +2033,6 @@ export class FxFore extends HTMLElement {
|
|
|
2025
2033
|
continue;
|
|
2026
2034
|
}
|
|
2027
2035
|
|
|
2028
|
-
if (!isValidName(parsed.localName)) {
|
|
2029
|
-
// This did not result in a valid name. Stop.
|
|
2030
|
-
console.warn(
|
|
2031
|
-
`Creating node for the XPath ${xpath} failed because the part ${parsed.localName} is not a valid Name.`,
|
|
2032
|
-
);
|
|
2033
|
-
return;
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
2036
|
const element = parsed.namespaceURI
|
|
2037
2037
|
? ownerDoc.createElementNS(parsed.namespaceURI, parsed.localName)
|
|
2038
2038
|
: ownerDoc.createElement(parsed.localName);
|
package/src/fx-model.js
CHANGED
|
@@ -133,10 +133,8 @@ export class FxModel extends HTMLElement {
|
|
|
133
133
|
const fore = model.formElement;
|
|
134
134
|
|
|
135
135
|
if (fore?.createNodes && (node === null || node === undefined)) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
model.registerModelItem(mi);
|
|
139
|
-
return mi;
|
|
136
|
+
// Do not create the model item. It may be exchanged later when create-nodes actually made the node
|
|
137
|
+
return null;
|
|
140
138
|
}
|
|
141
139
|
if (node === null || node === undefined) return null;
|
|
142
140
|
|
|
@@ -159,8 +157,10 @@ export class FxModel extends HTMLElement {
|
|
|
159
157
|
}
|
|
160
158
|
|
|
161
159
|
const isLensObject =
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
!!targetNode &&
|
|
161
|
+
typeof targetNode === 'object' &&
|
|
162
|
+
typeof targetNode.get === 'function' &&
|
|
163
|
+
typeof targetNode.set === 'function';
|
|
164
164
|
|
|
165
165
|
// If ModelItem for same path exists, RETARGET it (node OR lens)
|
|
166
166
|
if (path) {
|
|
@@ -182,12 +182,12 @@ export class FxModel extends HTMLElement {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
const mi = new ModelItem(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
path,
|
|
186
|
+
ref,
|
|
187
|
+
targetNode,
|
|
188
|
+
model.getBindForElement(targetNode),
|
|
189
|
+
instanceId,
|
|
190
|
+
fore,
|
|
191
191
|
);
|
|
192
192
|
mi.isSynthetic = true;
|
|
193
193
|
|
|
@@ -231,7 +231,8 @@ export class FxModel extends HTMLElement {
|
|
|
231
231
|
const defInst = this.getDefaultInstance();
|
|
232
232
|
if (defInst) {
|
|
233
233
|
const t = (defInst.getAttribute && defInst.getAttribute('type')) || defInst.type;
|
|
234
|
-
bindings.default =
|
|
234
|
+
bindings.default =
|
|
235
|
+
t === 'json' ? defInst.getInstanceData() : defInst.getDefaultContext();
|
|
235
236
|
}
|
|
236
237
|
} catch (_e) {
|
|
237
238
|
// ignore
|
|
@@ -734,14 +735,14 @@ export class FxModel extends HTMLElement {
|
|
|
734
735
|
|
|
735
736
|
// Path lookup
|
|
736
737
|
if (typeof nodeOrPath === 'string') {
|
|
737
|
-
const key = nodeOrPath.includes(':')
|
|
738
|
+
const key = nodeOrPath.includes(':')
|
|
739
|
+
? nodeOrPath.substring(0, nodeOrPath.indexOf(':'))
|
|
740
|
+
: nodeOrPath;
|
|
738
741
|
return this.modelItems.find(mi => mi.path === key) || null;
|
|
739
742
|
}
|
|
740
743
|
|
|
741
744
|
// Node/lens lookup
|
|
742
|
-
return (
|
|
743
|
-
this.modelItems.find(mi => mi.node === nodeOrPath || mi.lens === nodeOrPath) || null
|
|
744
|
-
);
|
|
745
|
+
return this.modelItems.find(mi => mi.node === nodeOrPath || mi.lens === nodeOrPath) || null;
|
|
745
746
|
}
|
|
746
747
|
|
|
747
748
|
/**
|
|
@@ -791,9 +792,9 @@ export class FxModel extends HTMLElement {
|
|
|
791
792
|
// ### lookup in parent Fore if present (shared instances)
|
|
792
793
|
if (!found) {
|
|
793
794
|
const parentFore =
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
this.fore.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE
|
|
796
|
+
? this.fore.parentNode.host.closest('fx-fore')
|
|
797
|
+
: this.fore.parentNode.closest('fx-fore');
|
|
797
798
|
|
|
798
799
|
if (parentFore) {
|
|
799
800
|
const parentInstances = parentFore.getModel().instances;
|