@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.
Files changed (102) hide show
  1. package/DOCS.md +41 -23
  2. package/README.md +15 -0
  3. package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs +30 -1
  4. package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs.map +1 -1
  5. package/common.js +23 -131
  6. package/common.js.map +1 -1
  7. package/framework-registry.d.ts +50 -0
  8. package/framework-registry.js +176 -0
  9. package/framework-registry.js.map +1 -0
  10. package/index.android.d.ts +1 -0
  11. package/index.android.js +1 -0
  12. package/index.android.js.map +1 -1
  13. package/index.d.ts +2 -1
  14. package/index.ios.d.ts +1 -0
  15. package/index.ios.js +1 -0
  16. package/index.ios.js.map +1 -1
  17. package/index.windows.d.ts +1 -0
  18. package/index.windows.js +1 -0
  19. package/index.windows.js.map +1 -1
  20. package/package.json +1 -1
  21. package/platforms/android/masonkit-release.aar +0 -0
  22. package/platforms/ios/Mason.xcframework/Info.plist +5 -5
  23. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +5 -2
  24. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  25. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  26. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +36460 -27573
  27. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +204 -201
  28. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  29. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +204 -201
  30. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7790 -7739
  32. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +5 -2039
  33. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  34. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  35. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  36. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +36460 -27573
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +204 -201
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +204 -201
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +36460 -27573
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +204 -201
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +204 -201
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +14 -80
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7785 -7734
  47. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +5 -2
  48. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Mason +0 -0
  49. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros.swiftsourceinfo +0 -0
  50. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.abi.json +36460 -27573
  51. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +204 -201
  52. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftdoc +0 -0
  53. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftinterface +204 -201
  54. package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  55. package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7286 -7233
  56. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +5 -2
  57. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Mason +0 -0
  58. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros-simulator.swiftsourceinfo +0 -0
  59. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.abi.json +36460 -27573
  60. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +204 -201
  61. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftdoc +0 -0
  62. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftinterface +204 -201
  63. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +14 -14
  64. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  65. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7286 -7233
  66. package/properties.js +1 -1
  67. package/properties.js.map +1 -1
  68. package/references.d.ts +5 -0
  69. package/style.d.ts +4 -4
  70. package/style.js +18 -3
  71. package/style.js.map +1 -1
  72. package/text-runs.d.ts +23 -0
  73. package/text-runs.js +65 -0
  74. package/text-runs.js.map +1 -0
  75. package/typings/android.d.ts +7327 -0
  76. package/typings/objc!Mason.d.ts +3963 -0
  77. package/typings/objc!ObjectiveC.d.ts +1640 -0
  78. package/typings/windows.d.ts +330 -0
  79. package/utils/index.android.d.ts +5 -2
  80. package/utils/index.android.js.map +1 -1
  81. package/utils/index.ios.d.ts +5 -2
  82. package/utils/index.ios.js.map +1 -1
  83. package/utils/index.windows.d.ts +5 -2
  84. package/utils/index.windows.js +5 -2
  85. package/utils/index.windows.js.map +1 -1
  86. package/vue/README.md +66 -0
  87. package/vue/index.d.ts +4 -0
  88. package/vue/index.d.ts.map +1 -0
  89. package/vue/index.js +3 -0
  90. package/vue/index.js.map +1 -0
  91. package/vue/package.json +39 -0
  92. package/vue/src/element-registry.d.ts +18 -0
  93. package/vue/src/element-registry.d.ts.map +1 -0
  94. package/vue/src/element-registry.js +56 -0
  95. package/vue/src/element-registry.js.map +1 -0
  96. package/vue/src/mason-meta.d.ts +7 -0
  97. package/vue/src/mason-meta.d.ts.map +1 -0
  98. package/vue/src/mason-meta.js +91 -0
  99. package/vue/src/mason-meta.js.map +1 -0
  100. package/web.js +11 -1
  101. package/web.js.map +1 -1
  102. 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
@@ -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,OAAO,IAAI,KAAK,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IAClF,CAAC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,IAAI,GAAG,EAAO,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,MA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