@nstudio/nativescript-compiler-effect-ui 9.2.0-alpha.21 → 9.2.0-alpha.23

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/LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright OpenJS Foundation and other contributors, https://openjsf.org
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nStudio
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
6
  of this software and associated documentation files (the "Software"), to deal
@@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
9
  copies of the Software, and to permit persons to whom the Software is
8
10
  furnished to do so, subject to the following conditions:
9
11
 
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
12
14
 
13
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/transform.js CHANGED
@@ -106,7 +106,14 @@ export function transformEffectSource(code, fileName) {
106
106
  out = out
107
107
  .replace(/class MasonAnchor extends \(A as unknown as new \(\) => NSView & \{ followHref: \(\) => void \}\) \{/, 'class MasonAnchor extends A {')
108
108
  .replace(/CSSType\('a'\)\(MasonAnchor\);/, '')
109
- .replace(/function makeBlockElement\(tag: string\): ElementConstructor \{\s*class MasonBlockElement extends Div \{\}\s*CSSType\(tag\)\(MasonBlockElement\);\s*return MasonBlockElement as unknown as ElementConstructor;\s*\}/, `function makeBlockElement(_tag: string): ElementConstructor {\n return Div as unknown as ElementConstructor;\n}`);
109
+ .replace(/function makeBlockElement\(tag: string\): ElementConstructor \{\s*class MasonBlockElement extends Div \{\}\s*CSSType\(tag\)\(MasonBlockElement\);\s*return MasonBlockElement as unknown as ElementConstructor;\s*\}/, (fn) => preserveLines(fn, `function makeBlockElement(tag: string): ElementConstructor {\n return (masonBlockElements[tag] ?? Div) as unknown as ElementConstructor;\n}`));
110
+ // A class made per tag at run time is one class per listed tag, each its tag's CSS type (`button { … }` rules).
111
+ const tags = /const BLOCK_OVERRIDE_TAGS = \[([^\]]*)\]/.exec(out)?.[1].match(/'[a-z][a-z0-9]*'/g)?.map((t) => t.slice(1, -1)) ?? [];
112
+ if (out.includes('masonBlockElements[tag]')) {
113
+ out +=
114
+ `\n${tags.map((t) => `@CSSType('${t}')\nclass MasonBlockElement_${t} extends Div {}`).join('\n')}\n` +
115
+ `const masonBlockElements: Record<string, ElementConstructor> = { ${tags.map((t) => `${t}: MasonBlockElement_${t} as unknown as ElementConstructor`).join(', ')} };\n`;
116
+ }
110
117
  }
111
118
  if (norm.endsWith('/mason/input-native.ts')) {
112
119
  return `import type { View as NSView } from '@nativescript/core';\nexport interface NativeInputHooks { readonly onEdit: () => void; readonly onReturn: () => void; }\nexport function syncNativeInput(_view: NSView, _tag: string): void {}\nexport function setNativeInputHooks(_view: NSView, _tag: string, _hooks: NativeInputHooks): void {}\nexport function dismissKeyboard(): void {}\nexport function installTapToDismissKeyboard(_view: NSView): () => void { return () => {}; }\n`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nstudio/nativescript-compiler-effect-ui",
3
- "version": "9.2.0-alpha.21",
3
+ "version": "9.2.0-alpha.23",
4
4
  "description": "The Effect UI adapter of @nstudio/nativescript-compiler: compiles a NativeScript app written with @effect/ui and Effect v4 into a native iOS or Android app with no JavaScript runtime.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -24,7 +24,7 @@
24
24
  "directory": "packages/effect-ui"
25
25
  },
26
26
  "peerDependencies": {
27
- "@nstudio/nativescript-compiler": "9.2.0-alpha.21"
27
+ "@nstudio/nativescript-compiler": "9.2.0-alpha.23"
28
28
  },
29
29
  "nativescript": {
30
30
  "compilerAdapter": {