@triniwiz/nativescript-masonkit 1.0.0-beta.96 → 1.0.0-beta.98
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/DOCS.md +41 -23
- package/README.md +15 -0
- package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs +30 -1
- package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs.map +1 -1
- package/common.js +23 -131
- package/common.js.map +1 -1
- package/framework-registry.d.ts +50 -0
- package/framework-registry.js +176 -0
- package/framework-registry.js.map +1 -0
- package/index.android.d.ts +1 -0
- package/index.android.js +1 -0
- package/index.android.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.ios.d.ts +1 -0
- package/index.ios.js +1 -0
- package/index.ios.js.map +1 -1
- package/index.windows.d.ts +1 -0
- package/index.windows.js +1 -0
- package/index.windows.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/Info.plist +5 -5
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +5 -2
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +36460 -27573
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7790 -7739
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +5 -2039
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +36460 -27573
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +36460 -27573
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +14 -80
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7785 -7734
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +5 -2
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.abi.json +36460 -27573
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7286 -7233
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +5 -2
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.abi.json +36460 -27573
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftinterface +204 -201
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +14 -14
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7286 -7233
- package/properties.js +1 -1
- package/properties.js.map +1 -1
- package/references.d.ts +5 -0
- package/style.d.ts +4 -4
- package/style.js +18 -3
- package/style.js.map +1 -1
- package/text-runs.d.ts +23 -0
- package/text-runs.js +65 -0
- package/text-runs.js.map +1 -0
- package/typings/android.d.ts +7327 -0
- package/typings/objc!Mason.d.ts +3963 -0
- package/typings/objc!ObjectiveC.d.ts +1640 -0
- package/typings/windows.d.ts +330 -0
- package/utils/index.android.d.ts +5 -2
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.d.ts +5 -2
- package/utils/index.ios.js.map +1 -1
- package/utils/index.windows.d.ts +5 -2
- package/utils/index.windows.js +5 -2
- package/utils/index.windows.js.map +1 -1
- package/vue/README.md +66 -0
- package/vue/index.d.ts +4 -0
- package/vue/index.d.ts.map +1 -0
- package/vue/index.js +3 -0
- package/vue/index.js.map +1 -0
- package/vue/package.json +39 -0
- package/vue/src/element-registry.d.ts +18 -0
- package/vue/src/element-registry.d.ts.map +1 -0
- package/vue/src/element-registry.js +56 -0
- package/vue/src/element-registry.js.map +1 -0
- package/vue/src/mason-meta.d.ts +7 -0
- package/vue/src/mason-meta.d.ts.map +1 -0
- package/vue/src/mason-meta.js +91 -0
- package/vue/src/mason-meta.js.map +1 -0
- package/web.js +11 -1
- package/web.js.map +1 -1
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +0 -8201
package/text-runs.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { MasonNodeKind } from './framework-registry';
|
|
2
|
+
export interface TextRunReconcileContext {
|
|
3
|
+
_children: any[];
|
|
4
|
+
_nativeRemoveChildNode(node: any, index: number): void;
|
|
5
|
+
_updateTextNode(node: any, operation: {
|
|
6
|
+
type: 'add' | 'replace' | 'insert';
|
|
7
|
+
index?: number;
|
|
8
|
+
isBreak?: boolean;
|
|
9
|
+
} | null): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reconcile the native text runs in `context._children` with the host
|
|
13
|
+
* framework's child nodes.
|
|
14
|
+
*
|
|
15
|
+
* `_children` holds one slot per box: elements and non-empty text runs. The
|
|
16
|
+
* framework's node list also carries nodes that generate no box on the web,
|
|
17
|
+
* and every framework has them - comment anchors for conditional/list
|
|
18
|
+
* rendering and empty text nodes. Neither gets a native run, so run indices
|
|
19
|
+
* come from counting slots, never from a node's position in the framework
|
|
20
|
+
* list. `classify` maps each framework node to its kind: `text` (a run),
|
|
21
|
+
* `break` (a `<br>` run), `element` (a slot with no run) or `none` (no slot).
|
|
22
|
+
*/
|
|
23
|
+
export declare function reconcileTextRuns(context: TextRunReconcileContext, nodes: any[], classify: (node: any) => MasonNodeKind): void;
|
package/text-runs.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { textNode_ } from './symbols';
|
|
2
|
+
/**
|
|
3
|
+
* Reconcile the native text runs in `context._children` with the host
|
|
4
|
+
* framework's child nodes.
|
|
5
|
+
*
|
|
6
|
+
* `_children` holds one slot per box: elements and non-empty text runs. The
|
|
7
|
+
* framework's node list also carries nodes that generate no box on the web,
|
|
8
|
+
* and every framework has them - comment anchors for conditional/list
|
|
9
|
+
* rendering and empty text nodes. Neither gets a native run, so run indices
|
|
10
|
+
* come from counting slots, never from a node's position in the framework
|
|
11
|
+
* list. `classify` maps each framework node to its kind: `text` (a run),
|
|
12
|
+
* `break` (a `<br>` run), `element` (a slot with no run) or `none` (no slot).
|
|
13
|
+
*/
|
|
14
|
+
export function reconcileTextRuns(context, nodes, classify) {
|
|
15
|
+
const textOf = (n) => n.text ?? n.data ?? '';
|
|
16
|
+
// A `<br>` that the host already inserted as a `Br` placeholder element
|
|
17
|
+
// (Vue/Angular metas do) is a slot of its own; only synthesise a break run
|
|
18
|
+
// for a framework node MasonKit has no child for.
|
|
19
|
+
const kinds = nodes.map((n) => {
|
|
20
|
+
const kind = classify(n);
|
|
21
|
+
return kind === 'break' && context._children.indexOf(n) > -1 ? 'element' : kind;
|
|
22
|
+
});
|
|
23
|
+
const live = new Set();
|
|
24
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
25
|
+
if (kinds[i] === 'break' || (kinds[i] === 'text' && textOf(nodes[i]) !== '')) {
|
|
26
|
+
live.add(nodes[i]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Drop native runs whose framework node is gone or has become empty.
|
|
30
|
+
for (let i = context._children.length - 1; i >= 0; i--) {
|
|
31
|
+
const child = context._children[i];
|
|
32
|
+
const raw = child?.[textNode_]?.['__raw__'];
|
|
33
|
+
if (raw && !live.has(raw)) {
|
|
34
|
+
context._nativeRemoveChildNode(child[textNode_], i);
|
|
35
|
+
context._children.splice(i, 1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
let slot = 0;
|
|
39
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
40
|
+
const node = nodes[i];
|
|
41
|
+
const kind = kinds[i];
|
|
42
|
+
if (kind === 'none' || (kind === 'text' && textOf(node) === '')) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (kind === 'element') {
|
|
46
|
+
slot++;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const existingIndex = context._children.findIndex((child) => child?.[textNode_]?.['__raw__'] === node);
|
|
50
|
+
if (existingIndex === slot) {
|
|
51
|
+
// Same node in the same slot: update the run's text in place.
|
|
52
|
+
context._updateTextNode(node, null);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
if (existingIndex > -1) {
|
|
56
|
+
const existing = context._children[existingIndex];
|
|
57
|
+
context._nativeRemoveChildNode(existing[textNode_], existingIndex);
|
|
58
|
+
context._children.splice(existingIndex, 1);
|
|
59
|
+
}
|
|
60
|
+
context._updateTextNode(node, { type: 'insert', index: slot, isBreak: kind === 'break' });
|
|
61
|
+
}
|
|
62
|
+
slot++;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=text-runs.js.map
|
package/text-runs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-runs.js","sourceRoot":"","sources":["../../../packages/nativescript-masonkit/text-runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAgBtC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgC,EAAE,KAAY,EAAE,QAAsC;IACtH,MAAM,MAAM,GAAG,CAAC,CAAM,EAAU,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IAC1D,wEAAwE;IACxE,2EAA2E;IAC3E,kDAAkD;IAClD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACzB,OA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