@nstudio/nativescript-effect-ui 0.1.0 → 0.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +52 -18
  3. package/dist/desktop/html-services.d.ts +33 -0
  4. package/dist/desktop/html-services.d.ts.map +1 -0
  5. package/dist/desktop/html-services.js +113 -0
  6. package/dist/desktop/html-services.js.map +1 -0
  7. package/dist/linux/LinuxHost.d.ts +108 -0
  8. package/dist/linux/LinuxHost.d.ts.map +1 -0
  9. package/dist/linux/LinuxHost.js +609 -0
  10. package/dist/linux/LinuxHost.js.map +1 -0
  11. package/dist/linux/index.d.ts +3 -0
  12. package/dist/linux/index.d.ts.map +1 -0
  13. package/dist/linux/index.js +3 -0
  14. package/dist/linux/index.js.map +1 -0
  15. package/dist/linux/platform.d.ts +17 -0
  16. package/dist/linux/platform.d.ts.map +1 -0
  17. package/dist/linux/platform.js +119 -0
  18. package/dist/linux/platform.js.map +1 -0
  19. package/dist/macos/MacosHost.d.ts +13 -0
  20. package/dist/macos/MacosHost.d.ts.map +1 -1
  21. package/dist/macos/MacosHost.js +373 -12
  22. package/dist/macos/MacosHost.js.map +1 -1
  23. package/dist/macos/styles.d.ts.map +1 -1
  24. package/dist/macos/styles.js +4 -1
  25. package/dist/macos/styles.js.map +1 -1
  26. package/dist/mason/MasonHost.d.ts +35 -1
  27. package/dist/mason/MasonHost.d.ts.map +1 -1
  28. package/dist/mason/MasonHost.js +330 -18
  29. package/dist/mason/MasonHost.js.map +1 -1
  30. package/dist/mason/dialog.d.ts +24 -1
  31. package/dist/mason/dialog.d.ts.map +1 -1
  32. package/dist/mason/dialog.js +162 -2
  33. package/dist/mason/dialog.js.map +1 -1
  34. package/dist/mason/elements.d.ts.map +1 -1
  35. package/dist/mason/elements.js +33 -6
  36. package/dist/mason/elements.js.map +1 -1
  37. package/dist/mason/events.d.ts +4 -0
  38. package/dist/mason/events.d.ts.map +1 -1
  39. package/dist/mason/events.js +110 -2
  40. package/dist/mason/events.js.map +1 -1
  41. package/dist/mason/index.d.ts +2 -1
  42. package/dist/mason/index.d.ts.map +1 -1
  43. package/dist/mason/index.js +2 -1
  44. package/dist/mason/index.js.map +1 -1
  45. package/dist/mason/input-native.d.ts +32 -0
  46. package/dist/mason/input-native.d.ts.map +1 -0
  47. package/dist/mason/input-native.js +280 -0
  48. package/dist/mason/input-native.js.map +1 -0
  49. package/dist/mason/media.d.ts +18 -0
  50. package/dist/mason/media.d.ts.map +1 -0
  51. package/dist/mason/media.js +255 -0
  52. package/dist/mason/media.js.map +1 -0
  53. package/dist/mason/select.d.ts +25 -0
  54. package/dist/mason/select.d.ts.map +1 -0
  55. package/dist/mason/select.js +75 -0
  56. package/dist/mason/select.js.map +1 -0
  57. package/dist/mason/services.d.ts +2 -1
  58. package/dist/mason/services.d.ts.map +1 -1
  59. package/dist/mason/services.js +61 -75
  60. package/dist/mason/services.js.map +1 -1
  61. package/dist/mason/styles.d.ts +16 -0
  62. package/dist/mason/styles.d.ts.map +1 -1
  63. package/dist/mason/styles.js +138 -19
  64. package/dist/mason/styles.js.map +1 -1
  65. package/dist/mason/svg.d.ts +86 -0
  66. package/dist/mason/svg.d.ts.map +1 -0
  67. package/dist/mason/svg.js +932 -0
  68. package/dist/mason/svg.js.map +1 -0
  69. package/dist/mason/video.d.ts +40 -0
  70. package/dist/mason/video.d.ts.map +1 -0
  71. package/dist/mason/video.js +641 -0
  72. package/dist/mason/video.js.map +1 -0
  73. package/dist/motion/index.d.ts +8 -8
  74. package/dist/platform/index.d.ts +1 -1
  75. package/dist/platform/index.d.ts.map +1 -1
  76. package/dist/platform/intl-mapping.d.ts +124 -0
  77. package/dist/platform/intl-mapping.d.ts.map +1 -0
  78. package/dist/platform/intl-mapping.js +540 -0
  79. package/dist/platform/intl-mapping.js.map +1 -0
  80. package/dist/platform/intl-polyfill.d.ts +60 -0
  81. package/dist/platform/intl-polyfill.d.ts.map +1 -0
  82. package/dist/platform/intl-polyfill.js +389 -0
  83. package/dist/platform/intl-polyfill.js.map +1 -0
  84. package/dist/platform/intl.d.ts +9 -0
  85. package/dist/platform/intl.d.ts.map +1 -0
  86. package/dist/platform/intl.js +219 -0
  87. package/dist/platform/intl.js.map +1 -0
  88. package/dist/platform/native.d.ts +1 -1
  89. package/dist/platform/native.d.ts.map +1 -1
  90. package/dist/platform/native.js +89 -14
  91. package/dist/platform/native.js.map +1 -1
  92. package/dist/postcss/color.d.ts +18 -0
  93. package/dist/postcss/color.d.ts.map +1 -0
  94. package/dist/postcss/color.js +620 -0
  95. package/dist/postcss/color.js.map +1 -0
  96. package/dist/postcss/index.d.ts +39 -0
  97. package/dist/postcss/index.d.ts.map +1 -0
  98. package/dist/postcss/index.js +249 -0
  99. package/dist/postcss/index.js.map +1 -0
  100. package/dist/postcss/values.d.ts +49 -0
  101. package/dist/postcss/values.d.ts.map +1 -0
  102. package/dist/postcss/values.js +259 -0
  103. package/dist/postcss/values.js.map +1 -0
  104. package/dist/testing/MockMasonHost.d.ts +2 -2
  105. package/dist/testing/MockMasonHost.d.ts.map +1 -1
  106. package/dist/testing/MockMasonHost.js +1 -1
  107. package/dist/testing/MockMasonHost.js.map +1 -1
  108. package/dist/windows/WindowsHost.d.ts +107 -0
  109. package/dist/windows/WindowsHost.d.ts.map +1 -0
  110. package/dist/windows/WindowsHost.js +659 -0
  111. package/dist/windows/WindowsHost.js.map +1 -0
  112. package/dist/windows/index.d.ts +3 -0
  113. package/dist/windows/index.d.ts.map +1 -0
  114. package/dist/windows/index.js +3 -0
  115. package/dist/windows/index.js.map +1 -0
  116. package/dist/windows/platform.d.ts +12 -0
  117. package/dist/windows/platform.d.ts.map +1 -0
  118. package/dist/windows/platform.js +105 -0
  119. package/dist/windows/platform.js.map +1 -0
  120. package/package.json +61 -4
@@ -0,0 +1,39 @@
1
+ import type { AcceptedPlugin, Plugin } from 'postcss';
2
+ export { DEFAULT_SPACING, convertMediaQuery, convertModernColor, normalizeLineHeight, normalizeMasonDeclaration, } from './values.ts';
3
+ export interface MasonPostcssOptions {
4
+ /**
5
+ * Directory `@tailwindcss/postcss` and `@nativescript/tailwind` are resolved
6
+ * from (the app's own copies). Defaults to `process.cwd()`.
7
+ */
8
+ readonly projectRoot?: string;
9
+ /**
10
+ * Options for `@tailwindcss/postcss`, or `false` to leave Tailwind out of the
11
+ * chain. `optimize` is always off: its Lightning CSS pass appends `px` to the
12
+ * unitless lengths NativeScript reads as DIPs.
13
+ */
14
+ readonly tailwind?: Readonly<Record<string, unknown>> | false;
15
+ }
16
+ export interface MasonPostcssPluginOptions {
17
+ /**
18
+ * The `@nativescript/tailwind` PostCSS plugin/processor, run between the
19
+ * guard steps; `null` skips it.
20
+ */
21
+ readonly nsTailwind: AcceptedPlugin | null;
22
+ }
23
+ /**
24
+ * The full chain for a NativeScript + MasonKit app: `@tailwindcss/postcss`
25
+ * followed by {@link masonPostcss}. Keep it last in the PostCSS plugin list.
26
+ */
27
+ export declare function masonPostcssPlugins(options?: MasonPostcssOptions): AcceptedPlugin[];
28
+ /**
29
+ * Runs after `@tailwindcss/postcss`:
30
+ * 1. flattens CSS nesting (core's parser drops everything after a nested rule);
31
+ * 2. rewrites values MasonKit/core can't read ({@link normalizeMasonDeclaration})
32
+ * and splits symmetric logical axis shorthands into physical sides;
33
+ * 3. converts `@media` preludes to what core evaluates and drops the rest;
34
+ * 4. runs `@nativescript/tailwind`, restoring every declaration and `@media`
35
+ * rule it deletes (MasonKit supports far more CSS than core), and keeping
36
+ * `line-height` values exactly as normalized.
37
+ */
38
+ export declare function masonPostcss(options: MasonPostcssPluginOptions): Plugin;
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/postcss/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAA6C,MAAM,EAAQ,MAAM,SAAS,CAAC;AAIvG,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC;CAC/D;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;CAC5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,mBAAwB,GAAG,cAAc,EAAE,CAUvF;AAyCD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,yBAAyB,GAAG,MAAM,CA2BvE"}
@@ -0,0 +1,249 @@
1
+ /**
2
+ * PostCSS pipeline that turns Tailwind v4 / modern web CSS into stylesheets
3
+ * NativeScript core and MasonKit apply correctly. Node-only (build time); the
4
+ * runtime-safe value rewrites live in `./values`.
5
+ *
6
+ * ```ts
7
+ * // vite.config.ts
8
+ * import { masonPostcssPlugins } from '@nstudio/nativescript-effect-ui/postcss';
9
+ * css: { postcss: { plugins: masonPostcssPlugins() } }
10
+ * ```
11
+ */
12
+ import { createRequire } from 'node:module';
13
+ import { join } from 'node:path';
14
+ import postcssNesting from 'postcss-nesting';
15
+ import { DEFAULT_SPACING, convertMediaQuery, normalizeMasonDeclaration, resolveRem, resolveSpacingCalc } from "./values.js";
16
+ export { DEFAULT_SPACING, convertMediaQuery, convertModernColor, normalizeLineHeight, normalizeMasonDeclaration, } from "./values.js";
17
+ /**
18
+ * The full chain for a NativeScript + MasonKit app: `@tailwindcss/postcss`
19
+ * followed by {@link masonPostcss}. Keep it last in the PostCSS plugin list.
20
+ */
21
+ export function masonPostcssPlugins(options = {}) {
22
+ const appRequire = createRequire(join(options.projectRoot ?? process.cwd(), 'package.json'));
23
+ const nsTailwind = appRequire('@nativescript/tailwind');
24
+ const plugins = [];
25
+ if (options.tailwind !== false) {
26
+ const tailwind = loadTailwindPostcss(appRequire);
27
+ plugins.push(tailwind({ ...options.tailwind, optimize: false }));
28
+ }
29
+ plugins.push(masonPostcss({ nsTailwind }));
30
+ return plugins;
31
+ }
32
+ /** The app's `@tailwindcss/postcss`, else the copy `@nativescript/tailwind` depends on. */
33
+ function loadTailwindPostcss(appRequire) {
34
+ const unwrap = (mod) => (mod.default ?? mod);
35
+ try {
36
+ return unwrap(appRequire('@tailwindcss/postcss'));
37
+ }
38
+ catch (error) {
39
+ const viaNsTailwind = createRequire(appRequire.resolve('@nativescript/tailwind'));
40
+ try {
41
+ return unwrap(viaNsTailwind('@tailwindcss/postcss'));
42
+ }
43
+ catch {
44
+ throw error;
45
+ }
46
+ }
47
+ }
48
+ const MEDIA_STASH = 'ns-mason-media';
49
+ const KEEP = '--ns-mason-keep-';
50
+ const KEEP_MARK = 'nsMasonKeep';
51
+ /** Renamed past `@nativescript/tailwind`, which drops rules using them; MasonKit matches them. */
52
+ const PSEUDO_ALIASES = [
53
+ [':hover', ':-ns-mason-hover'],
54
+ [':focus-within', ':-ns-mason-focus-within'],
55
+ ];
56
+ /**
57
+ * Declarations whose value must reach the app exactly as normalized here:
58
+ * `@nativescript/tailwind` rewrites `em`/`rem` to bare numbers, which a
59
+ * `line-height` would read as a font-size multiplier.
60
+ */
61
+ const VALUE_PROTECTED = new Set(['line-height', '--tw-leading']);
62
+ /**
63
+ * Runs after `@tailwindcss/postcss`:
64
+ * 1. flattens CSS nesting (core's parser drops everything after a nested rule);
65
+ * 2. rewrites values MasonKit/core can't read ({@link normalizeMasonDeclaration})
66
+ * and splits symmetric logical axis shorthands into physical sides;
67
+ * 3. converts `@media` preludes to what core evaluates and drops the rest;
68
+ * 4. runs `@nativescript/tailwind`, restoring every declaration and `@media`
69
+ * rule it deletes (MasonKit supports far more CSS than core), and keeping
70
+ * `line-height` values exactly as normalized.
71
+ */
72
+ export function masonPostcss(options) {
73
+ const { nsTailwind } = options;
74
+ return {
75
+ postcssPlugin: 'ns-effect-ui-mason',
76
+ Once(root, { result, postcss }) {
77
+ const run = (plugins) => {
78
+ const nested = postcss(plugins).process(root, { from: result.opts.from });
79
+ // `.root` processes synchronously and in place; both plugins are sync.
80
+ void nested.root;
81
+ result.messages.push(...nested.messages);
82
+ };
83
+ run([postcssNesting()]);
84
+ const spacing = themeSpacing(root);
85
+ root.walkDecls((decl) => {
86
+ decl.value = normalizeMasonDeclaration(decl.prop, decl.value, { spacing });
87
+ splitLogicalAxis(decl);
88
+ });
89
+ stashMedia(root);
90
+ if (nsTailwind) {
91
+ const originals = guardBefore(root);
92
+ run([nsTailwind]);
93
+ guardAfter(root, originals, spacing);
94
+ }
95
+ restoreMedia(root);
96
+ },
97
+ };
98
+ }
99
+ /**
100
+ * Tailwind's `px-*`/`py-*`/`mx-*`/`inset-x-*` emit logical axis shorthands,
101
+ * which core doesn't know (only MasonKit registers them). With one value they
102
+ * mean the same on both sides in horizontal writing, so physical longhands
103
+ * work on every view.
104
+ */
105
+ const LOGICAL_AXES = {
106
+ 'padding-inline': ['padding-left', 'padding-right'],
107
+ 'padding-block': ['padding-top', 'padding-bottom'],
108
+ 'margin-inline': ['margin-left', 'margin-right'],
109
+ 'margin-block': ['margin-top', 'margin-bottom'],
110
+ 'inset-inline': ['left', 'right'],
111
+ 'inset-block': ['top', 'bottom'],
112
+ };
113
+ function splitLogicalAxis(decl) {
114
+ const sides = LOGICAL_AXES[decl.prop];
115
+ if (!sides)
116
+ return;
117
+ let depth = 0;
118
+ const topLevelSpace = [...decl.value.trim()].some((ch) => {
119
+ if (ch === '(')
120
+ depth++;
121
+ else if (ch === ')')
122
+ depth--;
123
+ return depth === 0 && /\s/.test(ch);
124
+ });
125
+ if (topLevelSpace)
126
+ return;
127
+ decl.cloneBefore({ prop: sides[0] });
128
+ decl.prop = sides[1];
129
+ }
130
+ /** CSS px per `var(--spacing)` step, from the theme's root `--spacing`. */
131
+ function themeSpacing(root) {
132
+ let spacing = DEFAULT_SPACING;
133
+ root.walkDecls('--spacing', (decl) => {
134
+ const parent = decl.parent;
135
+ if (parent?.type !== 'rule' || !/:root|:host/.test(parent.selector ?? ''))
136
+ return;
137
+ const m = /^\s*((?:\d+\.?\d*|\.\d+))(rem|px)?\s*$/.exec(decl.value);
138
+ if (m) {
139
+ spacing = m[2] === 'rem' ? Number(m[1]) * 16 : Number(m[1]);
140
+ return false;
141
+ }
142
+ return undefined;
143
+ });
144
+ return spacing;
145
+ }
146
+ function stashMedia(root) {
147
+ root.walkAtRules('media', (rule) => {
148
+ const params = convertMediaQuery(rule.params);
149
+ if (params === null) {
150
+ rule.remove();
151
+ return;
152
+ }
153
+ rule.params = params;
154
+ rule.name = MEDIA_STASH;
155
+ });
156
+ // Stacked Tailwind variants (`sm:max-md:`) nest one query inside another;
157
+ // a single combined query is what core's parser and matcher handle best.
158
+ root.walkAtRules(MEDIA_STASH, (rule) => {
159
+ const child = rule.nodes?.length === 1 ? rule.nodes[0] : undefined;
160
+ if (child?.type !== 'atrule' || child.name !== MEDIA_STASH)
161
+ return;
162
+ const simple = (params) => !params.includes(',') && params.startsWith('(');
163
+ if (!simple(rule.params) || !simple(child.params))
164
+ return;
165
+ rule.params = `${rule.params} and ${child.params}`;
166
+ child.replaceWith(child.nodes ?? []);
167
+ });
168
+ }
169
+ function restoreMedia(root) {
170
+ root.walkAtRules(MEDIA_STASH, (rule) => {
171
+ if (!rule.nodes || rule.nodes.length === 0) {
172
+ rule.remove();
173
+ return;
174
+ }
175
+ rule.name = 'media';
176
+ });
177
+ }
178
+ const marks = (node) => node.raws;
179
+ /**
180
+ * Pairs each declaration with a `--ns-mason-keep-N` sibling; custom
181
+ * properties survive `@nativescript/tailwind`, so the sibling marks where a
182
+ * deleted declaration belongs.
183
+ */
184
+ function guardBefore(root) {
185
+ const originals = new Map();
186
+ let id = 0;
187
+ root.walkDecls((decl) => {
188
+ if (decl.prop.startsWith('--') && !VALUE_PROTECTED.has(decl.prop))
189
+ return;
190
+ const key = String(id++);
191
+ originals.set(key, { prop: decl.prop, value: decl.value, important: decl.important === true });
192
+ decl.cloneAfter({ prop: KEEP + key, value: '0', important: false });
193
+ marks(decl)[KEEP_MARK] = key;
194
+ });
195
+ root.walkRules((rule) => {
196
+ for (const [pseudo, alias] of PSEUDO_ALIASES) {
197
+ if (rule.selector.includes(pseudo))
198
+ rule.selector = rule.selector.split(pseudo).join(alias);
199
+ }
200
+ });
201
+ return originals;
202
+ }
203
+ function guardAfter(root, originals, spacing) {
204
+ root.walkDecls((decl) => {
205
+ if (!decl.prop.startsWith(KEEP))
206
+ return;
207
+ const key = decl.prop.slice(KEEP.length);
208
+ const original = originals.get(key);
209
+ const parent = decl.parent;
210
+ if (!original || !parent) {
211
+ decl.remove();
212
+ return;
213
+ }
214
+ const kept = parent.nodes?.find((node) => node !== decl && node.type === 'decl' && marks(node)[KEEP_MARK] === key);
215
+ if (kept) {
216
+ if (VALUE_PROTECTED.has(original.prop))
217
+ kept.value = original.value;
218
+ delete marks(kept)[KEEP_MARK];
219
+ decl.remove();
220
+ return;
221
+ }
222
+ decl.replaceWith(decl.clone({
223
+ prop: original.prop,
224
+ value: restoredValue(original.prop, original.value, spacing),
225
+ important: original.important,
226
+ }));
227
+ });
228
+ root.walkRules((rule) => {
229
+ for (const [pseudo, alias] of PSEUDO_ALIASES) {
230
+ if (rule.selector.includes(alias))
231
+ rule.selector = rule.selector.split(alias).join(pseudo);
232
+ }
233
+ });
234
+ }
235
+ /**
236
+ * A declaration `@nativescript/tailwind` deleted gets the unit handling it
237
+ * applies to the ones it keeps: spacing steps and `rem` become unitless CSS px.
238
+ */
239
+ function restoredValue(prop, value, spacing) {
240
+ if (VALUE_PROTECTED.has(prop))
241
+ return value;
242
+ let v = resolveRem(resolveSpacingCalc(value, spacing));
243
+ // Tailwind's `repeat(N, minmax(0, 1fr))` as the plain track list MasonKit parses.
244
+ if (prop === 'grid-template-columns' || prop === 'grid-template-rows') {
245
+ v = v.replace(/repeat\(\s*(\d+)\s*,\s*minmax\(\s*0\s*,\s*1fr\s*\)\s*\)/g, (_, count) => Array.from({ length: Number(count) }, () => '1fr').join(' '));
246
+ }
247
+ return v;
248
+ }
249
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/postcss/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE5H,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAwBrB;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAA+B,EAAE;IACnE,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IAC7F,MAAM,UAAU,GAAG,UAAU,CAAC,wBAAwB,CAAmB,CAAC;IAC1E,MAAM,OAAO,GAAqB,EAAE,CAAC;IACrC,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC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AAI,IAAI,KAAK,oBAAoB,EAAE,CAAC;QACtE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,0DAA0D,EAAE,CAAC,CAAC,EAAE,KAAa,EAAE,EAAE,CAC7F,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Pure CSS value rewrites shared by the build-time PostCSS pipeline and
3
+ * runtime inline `style` handling, so stylesheet rules and inline styles reach
4
+ * MasonKit in the same form.
5
+ *
6
+ * Dependency-free: safe to import in the NativeScript runtime.
7
+ */
8
+ import { convertModernColor } from './color.ts';
9
+ export { convertModernColor };
10
+ /** Tailwind v4's default `--spacing` (0.25rem) in CSS px. */
11
+ export declare const DEFAULT_SPACING = 4;
12
+ export interface MasonValueOptions {
13
+ /** CSS px per `var(--spacing)` step; defaults to {@link DEFAULT_SPACING}. */
14
+ readonly spacing?: number;
15
+ }
16
+ /** `calc(var(--spacing) * N)` → `N * spacing` (unitless, CSS px), or with `unit` appended. */
17
+ export declare function resolveSpacingCalc(value: string, spacing?: number, unit?: string): string;
18
+ /** `Nrem` → `N * 16` (unitless, CSS px), or with `unit` appended. */
19
+ export declare function resolveRem(value: string, unit?: string): string;
20
+ /**
21
+ * MasonKit reads a unitless `line-height` as a multiplier of the font size and
22
+ * a length (`32px`) as the line box height, like CSS. Lengths must therefore
23
+ * keep a unit: Tailwind's `calc(var(--spacing) * 8)` and `2rem` become `32px`,
24
+ * never a bare `32`. A percentage is a font-size multiple, so `150%` becomes `1.5`.
25
+ */
26
+ export declare function normalizeLineHeight(value: string, spacing?: number): string;
27
+ /**
28
+ * Rewrites one declaration value into the form MasonKit lays out correctly:
29
+ * - `display: inline-flex | inline-grid` → `flex | grid` (flex/grid items are
30
+ * blockified anyway; in block flow the box fills the line instead of shrinking)
31
+ * - `position: sticky` → `relative` (MasonKit has no sticky positioning)
32
+ * - `position: fixed` → `absolute`: MasonKit re-parents fixed boxes natively,
33
+ * placing them offset by their root's window origin twice and aborting the
34
+ * app when one is removed. `MasonHost` renders `<dialog>` in a full-window
35
+ * top layer, so `absolute` inside a dialog still covers the viewport.
36
+ * - `Ndvh/svh/lvh` (and `vw`/`vmin`/`vmax` variants) → `Nvh` etc.
37
+ * - `line-height` / `--tw-leading` lengths keep a unit (see {@link normalizeLineHeight})
38
+ * - modern colour functions → `#rrggbb` / `rgba()` (see {@link convertModernColor})
39
+ */
40
+ export declare function normalizeMasonDeclaration(prop: string, value: string, options?: MasonValueOptions): string;
41
+ /**
42
+ * Rewrites a Media Queries Level 4 prelude into the subset NativeScript core
43
+ * evaluates (`min-`/`max-` `width`/`height`/`device-*`, `orientation`,
44
+ * `prefers-color-scheme`): `(width >= 48rem)` → `(min-width: 768)`.
45
+ * Queries core can't evaluate are dropped from the list; returns null when
46
+ * none is left, meaning the whole `@media` rule can never match.
47
+ */
48
+ export declare function convertMediaQuery(params: string): string | null;
49
+ //# sourceMappingURL=values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/postcss/values.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,6DAA6D;AAC7D,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAOD,8FAA8F;AAC9F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,SAAkB,EAAE,IAAI,SAAK,GAAG,MAAM,CAE9F;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,SAAkB,GAAG,MAAM,CAIpF;AAWD;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAa9G;AAoJD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiB/D"}
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Pure CSS value rewrites shared by the build-time PostCSS pipeline and
3
+ * runtime inline `style` handling, so stylesheet rules and inline styles reach
4
+ * MasonKit in the same form.
5
+ *
6
+ * Dependency-free: safe to import in the NativeScript runtime.
7
+ */
8
+ import { convertModernColor } from "./color.js";
9
+ export { convertModernColor };
10
+ /** Tailwind v4's default `--spacing` (0.25rem) in CSS px. */
11
+ export const DEFAULT_SPACING = 4;
12
+ const round = (n) => Math.round(n * 10000) / 10000;
13
+ const SPACING_CALC = /calc\(\s*var\(--spacing\)\s*\*\s*(-?(?:\d+\.?\d*|\.\d+))\s*\)/g;
14
+ const REM = /(-?(?:\d+\.?\d*|\.\d+))rem\b/g;
15
+ /** `calc(var(--spacing) * N)` → `N * spacing` (unitless, CSS px), or with `unit` appended. */
16
+ export function resolveSpacingCalc(value, spacing = DEFAULT_SPACING, unit = '') {
17
+ return value.replace(SPACING_CALC, (_, n) => `${round(Number(n) * spacing)}${unit}`);
18
+ }
19
+ /** `Nrem` → `N * 16` (unitless, CSS px), or with `unit` appended. */
20
+ export function resolveRem(value, unit = '') {
21
+ return value.replace(REM, (_, n) => `${round(Number(n) * 16)}${unit}`);
22
+ }
23
+ /**
24
+ * MasonKit reads a unitless `line-height` as a multiplier of the font size and
25
+ * a length (`32px`) as the line box height, like CSS. Lengths must therefore
26
+ * keep a unit: Tailwind's `calc(var(--spacing) * 8)` and `2rem` become `32px`,
27
+ * never a bare `32`. A percentage is a font-size multiple, so `150%` becomes `1.5`.
28
+ */
29
+ export function normalizeLineHeight(value, spacing = DEFAULT_SPACING) {
30
+ const v = resolveRem(resolveSpacingCalc(value.trim(), spacing, 'px'), 'px');
31
+ const percent = /^(\d+\.?\d*|\.\d+)%$/.exec(v);
32
+ return percent ? String(round(Number(percent[1]) / 100)) : v;
33
+ }
34
+ /** Inline-level displays MasonKit lays out as blocks, mapped to their block-level twin. */
35
+ const DISPLAY_FALLBACKS = {
36
+ 'inline-flex': 'flex',
37
+ 'inline-grid': 'grid',
38
+ };
39
+ /** Dynamic/small/large viewport units → the plain unit MasonKit resolves against the window. */
40
+ const VIEWPORT_VARIANT = /(\d|\.)[dsl](vh|vw|vmin|vmax)\b/gi;
41
+ /**
42
+ * Rewrites one declaration value into the form MasonKit lays out correctly:
43
+ * - `display: inline-flex | inline-grid` → `flex | grid` (flex/grid items are
44
+ * blockified anyway; in block flow the box fills the line instead of shrinking)
45
+ * - `position: sticky` → `relative` (MasonKit has no sticky positioning)
46
+ * - `position: fixed` → `absolute`: MasonKit re-parents fixed boxes natively,
47
+ * placing them offset by their root's window origin twice and aborting the
48
+ * app when one is removed. `MasonHost` renders `<dialog>` in a full-window
49
+ * top layer, so `absolute` inside a dialog still covers the viewport.
50
+ * - `Ndvh/svh/lvh` (and `vw`/`vmin`/`vmax` variants) → `Nvh` etc.
51
+ * - `line-height` / `--tw-leading` lengths keep a unit (see {@link normalizeLineHeight})
52
+ * - modern colour functions → `#rrggbb` / `rgba()` (see {@link convertModernColor})
53
+ */
54
+ export function normalizeMasonDeclaration(prop, value, options = {}) {
55
+ const name = prop.trim().toLowerCase();
56
+ let v = value;
57
+ if (name === 'display') {
58
+ v = DISPLAY_FALLBACKS[v.trim().toLowerCase()] ?? v;
59
+ }
60
+ else if (name === 'position') {
61
+ if (/^(-webkit-)?sticky$/i.test(v.trim()))
62
+ v = 'relative';
63
+ else if (/^fixed$/i.test(v.trim()))
64
+ v = 'absolute';
65
+ }
66
+ else if (name === 'line-height' || name === '--tw-leading') {
67
+ v = normalizeLineHeight(v, options.spacing ?? DEFAULT_SPACING);
68
+ }
69
+ if (/\d[dsl]v/i.test(v))
70
+ v = v.replace(VIEWPORT_VARIANT, '$1$2');
71
+ return convertModernColor(v);
72
+ }
73
+ // ---------------------------------------------------------------------------
74
+ // Media queries
75
+ const LENGTH_FEATURES = new Set(['width', 'height', 'device-width', 'device-height']);
76
+ const KEYWORD_FEATURES = new Set(['orientation', 'prefers-color-scheme']);
77
+ const MEDIA_TYPES = new Set(['all', 'screen', 'print']);
78
+ /**
79
+ * A media-query length in CSS px (= NativeScript DIPs). Bare numbers are DIPs
80
+ * to core; `px` there would mean device pixels, so it is never emitted.
81
+ */
82
+ function mediaLength(text) {
83
+ const m = /^([+-]?(?:\d+\.?\d*|\.\d+))(px|r?em)?$/i.exec(text.trim());
84
+ if (!m)
85
+ return null;
86
+ const n = Number(m[1]);
87
+ return m[2] && /em$/i.test(m[2]) ? n * 16 : n;
88
+ }
89
+ const FLIP = { '<': '>', '<=': '>=', '>': '<', '>=': '<=', '=': '=' };
90
+ /**
91
+ * Core compares against the screen size in whole device pixels after
92
+ * rounding, so a strict bound is moved half a DIP inward to stay strict.
93
+ */
94
+ function rangeFeature(name, op, value) {
95
+ if (!LENGTH_FEATURES.has(name))
96
+ return null;
97
+ const dip = mediaLength(value);
98
+ if (dip === null)
99
+ return null;
100
+ switch (op) {
101
+ case '>=':
102
+ return `(min-${name}: ${round(dip)})`;
103
+ case '>':
104
+ return `(min-${name}: ${round(dip + 0.5)})`;
105
+ case '<=':
106
+ return `(max-${name}: ${round(dip)})`;
107
+ case '<':
108
+ return `(max-${name}: ${round(dip - 0.5)})`;
109
+ case '=':
110
+ return `(${name}: ${round(dip)})`;
111
+ default:
112
+ return null;
113
+ }
114
+ }
115
+ /** One `( ... )` media feature → the `(min-width: 768)` forms core evaluates, or null. */
116
+ function convertFeature(inner) {
117
+ const text = inner.trim();
118
+ const range = /^([^<>=]+?)\s*(<=|>=|<|>|=)\s*([^<>=]+?)(?:\s*(<=|>=|<|>|=)\s*([^<>=]+?))?$/.exec(text);
119
+ if (range && !/^[a-z-]+\s*:/i.test(text)) {
120
+ const [, a, op1, b, op2, c] = range;
121
+ const isName = (s) => /^[a-z-]+$/i.test(s.trim());
122
+ if (op2 !== undefined && c !== undefined) {
123
+ if (!isName(b))
124
+ return null;
125
+ const name = b.trim().toLowerCase();
126
+ const lower = rangeFeature(name, FLIP[op1], a);
127
+ const upper = rangeFeature(name, op2, c);
128
+ return lower && upper ? [lower, upper] : null;
129
+ }
130
+ if (isName(a)) {
131
+ const feature = rangeFeature(a.trim().toLowerCase(), op1, b);
132
+ return feature ? [feature] : null;
133
+ }
134
+ if (isName(b)) {
135
+ const feature = rangeFeature(b.trim().toLowerCase(), FLIP[op1], a);
136
+ return feature ? [feature] : null;
137
+ }
138
+ return null;
139
+ }
140
+ const plain = /^([a-z-]+)\s*:\s*(.+)$/i.exec(text);
141
+ if (!plain)
142
+ return null;
143
+ const name = plain[1].toLowerCase();
144
+ const base = name.replace(/^(min|max)-/, '');
145
+ if (LENGTH_FEATURES.has(base)) {
146
+ const dip = mediaLength(plain[2]);
147
+ return dip === null ? null : [`(${name}: ${round(dip)})`];
148
+ }
149
+ if (KEYWORD_FEATURES.has(name))
150
+ return [`(${name}: ${plain[2].trim().toLowerCase()})`];
151
+ return null;
152
+ }
153
+ /** Top-level words and `( ... )` groups of one media query. */
154
+ function mediaTokens(query) {
155
+ const tokens = [];
156
+ let i = 0;
157
+ while (i < query.length) {
158
+ const ch = query[i];
159
+ if (/\s/.test(ch)) {
160
+ i++;
161
+ }
162
+ else if (ch === '(') {
163
+ let depth = 0;
164
+ let j = i;
165
+ for (; j < query.length; j++) {
166
+ if (query[j] === '(')
167
+ depth++;
168
+ else if (query[j] === ')' && --depth === 0)
169
+ break;
170
+ }
171
+ if (j >= query.length)
172
+ return null;
173
+ tokens.push(query.slice(i, j + 1));
174
+ i = j + 1;
175
+ }
176
+ else {
177
+ const m = /^[^\s(]+/.exec(query.slice(i));
178
+ tokens.push(m[0]);
179
+ i += m[0].length;
180
+ }
181
+ }
182
+ return tokens;
183
+ }
184
+ function convertQuery(query) {
185
+ const tokens = mediaTokens(query);
186
+ if (!tokens || tokens.length === 0)
187
+ return null;
188
+ let i = 0;
189
+ let modifier = '';
190
+ let type = '';
191
+ const first = tokens[0].toLowerCase();
192
+ if (first === 'not' || first === 'only') {
193
+ modifier = first;
194
+ i++;
195
+ }
196
+ const maybeType = tokens[i];
197
+ if (maybeType !== undefined && !maybeType.startsWith('(')) {
198
+ type = maybeType.toLowerCase();
199
+ if (!MEDIA_TYPES.has(type))
200
+ return null;
201
+ i++;
202
+ }
203
+ const features = [];
204
+ let expectFeature = type === '';
205
+ for (; i < tokens.length; i++) {
206
+ const token = tokens[i];
207
+ if (expectFeature) {
208
+ if (!token.startsWith('('))
209
+ return null;
210
+ const converted = convertFeature(token.slice(1, -1));
211
+ if (!converted)
212
+ return null;
213
+ features.push(...converted);
214
+ expectFeature = false;
215
+ }
216
+ else {
217
+ if (token.toLowerCase() !== 'and')
218
+ return null;
219
+ expectFeature = true;
220
+ }
221
+ }
222
+ if (expectFeature)
223
+ return null;
224
+ // Core's grammar needs a media type after `not`/`only`.
225
+ if (modifier === 'not' && type === '')
226
+ type = 'all';
227
+ if (modifier === 'only' && type === '')
228
+ return null;
229
+ return [[modifier, type].filter(Boolean).join(' '), features.join(' and ')].filter(Boolean).join(' and ') || null;
230
+ }
231
+ /**
232
+ * Rewrites a Media Queries Level 4 prelude into the subset NativeScript core
233
+ * evaluates (`min-`/`max-` `width`/`height`/`device-*`, `orientation`,
234
+ * `prefers-color-scheme`): `(width >= 48rem)` → `(min-width: 768)`.
235
+ * Queries core can't evaluate are dropped from the list; returns null when
236
+ * none is left, meaning the whole `@media` rule can never match.
237
+ */
238
+ export function convertMediaQuery(params) {
239
+ const queries = [];
240
+ let depth = 0;
241
+ let current = '';
242
+ for (const ch of params) {
243
+ if (ch === '(')
244
+ depth++;
245
+ else if (ch === ')')
246
+ depth--;
247
+ if (ch === ',' && depth === 0) {
248
+ queries.push(current);
249
+ current = '';
250
+ }
251
+ else {
252
+ current += ch;
253
+ }
254
+ }
255
+ queries.push(current);
256
+ const converted = queries.map((q) => convertQuery(q.trim())).filter((q) => q !== null);
257
+ return converted.length > 0 ? converted.join(', ') : null;
258
+ }
259
+ //# sourceMappingURL=values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/postcss/values.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAOjC,MAAM,KAAK,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAEnE,MAAM,YAAY,GAAG,gEAAgE,CAAC;AACtF,MAAM,GAAG,GAAG,+BAA+B,CAAC;AAE5C,8FAA8F;AAC9F,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,OAAO,GAAG,eAAe,EAAE,IAAI,GAAG,EAAE;IACpF,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AAC/F,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,IAAI,GAAG,EAAE;IACjD,OAAO,KAAK,CAAC,OAAO,CAAC,G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
+ import type { DialogMode, DialogPresenter } from '../mason/dialog.js';
2
2
  type Listener = (event?: Record<string, unknown>) => void;
3
3
  export interface MockMasonView {
4
4
  readonly tag: string;
@@ -32,7 +32,7 @@ export interface MockMasonView {
32
32
  export declare function createMockMasonView(tag: string): MockMasonView;
33
33
  export interface MockDialogRecord {
34
34
  readonly dialog: MockMasonView;
35
- readonly mode: 'modal' | boolean;
35
+ readonly mode: DialogMode;
36
36
  readonly onCancel: () => void;
37
37
  readonly onClose: () => void;
38
38
  }