@ng-native/web 0.9.0 → 0.11.0
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/browser-engine.d.ts +2 -0
- package/dist/browser-engine.js +32 -0
- package/dist/browser-engine.js.map +1 -1
- package/dist/browser-renderer.d.ts +1 -1
- package/dist/browser-renderer.js +2 -0
- package/dist/browser-renderer.js.map +1 -1
- package/dist/dom-node.d.ts +1 -0
- package/dist/dom-node.js +25 -0
- package/dist/dom-node.js.map +1 -1
- package/dist/mount.js +2 -1
- package/dist/mount.js.map +1 -1
- package/dist/props.js +12 -0
- package/dist/props.js.map +1 -1
- package/dist/reset-css.d.ts +1 -1
- package/dist/reset-css.js +26 -0
- package/dist/reset-css.js.map +1 -1
- package/dist/reset.css +46 -0
- package/package.json +10 -8
package/dist/reset-css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-css.js","sourceRoot":"","sources":["../src/reset-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"reset-css.js","sourceRoot":"","sources":["../src/reset-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2TxB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC,OAAO,CAC1F,iBAAiB,EACjB,oBAAoB,CACrB,CAAC","sourcesContent":["/**\n * `reset.css`'s content, as a string `mount()` can inject with no bundler CSS loader required.\n *\n * A second copy of `reset.css`, because this package ships raw TypeScript with no build step of\n * its own (see `package.json`), so there is nothing here to run a codegen script as part of. A\n * consumer with no CSS loader in their bundler still gets a working stylesheet from\n * `mount({ injectReset: true })` alone, and an app that would rather control ordering against\n * Tailwind imports the `.css` file instead.\n *\n * `reset.css` is the one to read and to edit. This one carries the same rules with the comments\n * stripped, and `reset-parity.test.ts` fails the moment the two disagree about a single\n * declaration - which is not a nicety. The first edit after this file was written landed in the\n * `.css` only, and the version `mount` actually injects would have gone on shipping the old\n * rules with nothing to say so.\n */\nexport const RESET_CSS = `\n[data-rn] {\n box-sizing: border-box;\n position: relative;\n flex-shrink: 0;\n min-width: 0;\n min-height: 0;\n}\n\n[data-rn]:where(:not([data-rn='root'])) {\n border-width: 0;\n border-style: solid;\n border-color: black;\n}\n\nhtml,\nbody {\n height: 100%;\n}\n\n[data-rn-root] {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n\nbody {\n font-family: var(\n --font-sans,\n system-ui,\n -apple-system,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n Arial,\n sans-serif\n );\n font-size: 14px;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n[data-rn]:not([data-rn='text']):not(\n :where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n )\n ) {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n[data-rn='text'],\n:where(\n :is(\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n ):not(\n :has(\n [data-rn]:not(\n [data-rn='text'],\n [data-rn='span'],\n [data-rn='p'],\n [data-rn='h1'],\n [data-rn='h2'],\n [data-rn='h3'],\n [data-rn='h4'],\n [data-rn='h5'],\n [data-rn='h6'],\n [data-rn='label'],\n [data-rn='strong'],\n [data-rn='b'],\n [data-rn='em'],\n [data-rn='i'],\n [data-rn='u'],\n [data-rn='s'],\n [data-rn='small'],\n [data-rn='code'],\n [data-rn='mark'],\n [data-rn='abbr'],\n [data-rn='cite'],\n [data-rn='time']\n )\n )\n )\n)[data-rn] {\n display: inline;\n}\n\n:where(h1, h2, h3, h4, h5, h6, p)[data-rn] {\n font-size: inherit;\n font-weight: inherit;\n margin: 0;\n}\n\n:where(ul, ol)[data-rn] {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n:where(strong, b)[data-rn] {\n font-weight: bold;\n}\n\n:where(small)[data-rn] {\n font-size: 80%;\n}\n\n:where(code)[data-rn] {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 1em;\n}\n\n:where(mark)[data-rn] {\n background-color: rgb(255, 255, 0);\n color: rgb(0, 0, 0);\n}\n\n[data-rn='text']:where([numberoflines]:not([data-rn='text'] *)) {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--rn-number-of-lines);\n overflow: hidden;\n}\n\n[data-rn='text']:where([numberoflines][ellipsizemode='clip']:not([data-rn='text'] *)) {\n display: block;\n -webkit-line-clamp: none;\n max-height: calc(var(--rn-number-of-lines) * 1lh);\n}\n\n[data-rn='scroll-view'],\n[data-rn='virtual-list'] {\n flex-grow: 1;\n flex-shrink: 1;\n flex-direction: column;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rn='scroll-view'][flexdirection='row'] {\n flex-direction: row;\n}\n\n[data-rn='scroll-view'][scrollenabled='false'] {\n overflow: hidden;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'] {\n scroll-snap-type: y mandatory;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'][horizontal='true'] {\n scroll-snap-type: x mandatory;\n}\n\n[data-rn='scroll-view'][pagingenabled='true'] > [data-rn='view'] > * {\n scroll-snap-align: start;\n scroll-snap-stop: always;\n}\n\n[data-rn='image'] {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n:where([data-rn='image']) {\n width: var(--rn-intrinsic-width, auto);\n height: var(--rn-intrinsic-height, auto);\n}\n\n:where([data-rn='gesture-root']) {\n flex-grow: 1;\n flex-basis: 0%;\n}\n\n[data-rn='modal'] {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background-color: rgb(0 0 0 / 50%);\n}\n[data-rn='modal'][hidden] {\n display: none;\n}\n\n[data-rn='input-accessory-view'] {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n[data-rn='activity-indicator'] {\n color: #999999;\n}\n[data-rn='activity-indicator']::after {\n content: '';\n box-sizing: border-box;\n flex: 1;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: rn-activity-indicator 0.8s linear infinite;\n}\n[data-rn='activity-indicator'][animating='false']::after {\n animation-play-state: paused;\n}\n[data-rn='activity-indicator'][animating='false']:not([hideswhenstopped='false'])::after {\n visibility: hidden;\n}\n@keyframes rn-activity-indicator {\n to {\n transform: rotate(360deg);\n }\n}\n\n[data-rn='text-input'] {\n background-color: transparent;\n font: inherit;\n color: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n margin: 0;\n padding: 0;\n resize: none;\n}\n\n[data-rn='text-input']::placeholder {\n /* A device draws an unset placeholder grey; this is the text colour, faded, on any theme. */\n color: var(--rn-placeholder-color, color-mix(in srgb, currentColor 45%, transparent));\n}\n\n[data-rn='gradient-text'] {\n -webkit-background-clip: text;\n background-clip: text;\n}\n\n[data-rn='gradient-text'] > [data-rn='text'][data-rn] {\n color: transparent;\n}\n\n[data-rn='gradient-text'] > [data-rn='view'][data-rn] {\n display: none;\n}\n`;\n\n/**\n * The reset for an island inside someone else's page: `RESET_CSS` without the two rules that\n * reach outside the island.\n *\n * `html, body { height: 100% }` and `body`'s font are right for a page this package owns, and\n * wrong for a page it is a guest on - they would resize and re-font the host app around the\n * island. So they go, and the font moves onto `[data-rn-root]`, where text inside the island\n * still inherits it. Derived rather than written out, so it cannot drift from `RESET_CSS`.\n */\nexport const ISLAND_RESET_CSS = RESET_CSS.replace(/html,\\s*body\\s*\\{[^}]*\\}\\s*/, '').replace(\n /(^|\\n)body\\s*\\{/,\n '$1[data-rn-root] {',\n);\n"]}
|
package/dist/reset.css
CHANGED
|
@@ -284,6 +284,31 @@ body {
|
|
|
284
284
|
color: rgb(0, 0, 0);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
+
/*
|
|
288
|
+
* `text.ts`'s `numberOfLines`, which `props.ts` writes as an attribute and a custom property only
|
|
289
|
+
* while it is above zero. A device cuts the text to that many lines and ends the last in an
|
|
290
|
+
* ellipsis, and a line clamp is the browser's way to say the same. Only on the outermost text, as
|
|
291
|
+
* on a device, where a nested text is a run of its parent's paragraph and has no lines of its own:
|
|
292
|
+
* a nested one clamped would leave the paragraph's flow.
|
|
293
|
+
*
|
|
294
|
+
* `ellipsizeMode` reaches the element as a plain attribute. A line clamp always ends in an
|
|
295
|
+
* ellipsis, so `clip` cuts the box to that many lines' height instead, which a nested run in a
|
|
296
|
+
* larger font can make a little short. `head` and `middle` have nothing in CSS to say them with,
|
|
297
|
+
* and end in an ellipsis at the tail.
|
|
298
|
+
*/
|
|
299
|
+
[data-rn='text']:where([numberoflines]:not([data-rn='text'] *)) {
|
|
300
|
+
display: -webkit-box;
|
|
301
|
+
-webkit-box-orient: vertical;
|
|
302
|
+
-webkit-line-clamp: var(--rn-number-of-lines);
|
|
303
|
+
overflow: hidden;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
[data-rn='text']:where([numberoflines][ellipsizemode='clip']:not([data-rn='text'] *)) {
|
|
307
|
+
display: block;
|
|
308
|
+
-webkit-line-clamp: none;
|
|
309
|
+
max-height: calc(var(--rn-number-of-lines) * 1lh);
|
|
310
|
+
}
|
|
311
|
+
|
|
287
312
|
/*
|
|
288
313
|
* `ScrollView.js`'s own base style (`engine.ts`'s `DEFAULT_PROPS.ScrollView`): a native scroll
|
|
289
314
|
* view does not clip its content on its own, so without this the content spills straight out of
|
|
@@ -318,6 +343,27 @@ body {
|
|
|
318
343
|
overflow: hidden;
|
|
319
344
|
}
|
|
320
345
|
|
|
346
|
+
/*
|
|
347
|
+
* `pagingEnabled`, read the same way, along the axis `horizontal` names. A device settles on a
|
|
348
|
+
* whole page of the scroll view's own size when the user lets go, and moves at most one page per
|
|
349
|
+
* swipe. CSS snaps to boxes rather than to multiples of a size, so each child of the content view
|
|
350
|
+
* is a page here: the same thing for the usual carousel of page-sized children, and a stop at
|
|
351
|
+
* every child for children of another size. `scrollTo` lands on a page too, where a device goes
|
|
352
|
+
* to the exact offset it was given.
|
|
353
|
+
*/
|
|
354
|
+
[data-rn='scroll-view'][pagingenabled='true'] {
|
|
355
|
+
scroll-snap-type: y mandatory;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
[data-rn='scroll-view'][pagingenabled='true'][horizontal='true'] {
|
|
359
|
+
scroll-snap-type: x mandatory;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
[data-rn='scroll-view'][pagingenabled='true'] > [data-rn='view'] > * {
|
|
363
|
+
scroll-snap-align: start;
|
|
364
|
+
scroll-snap-stop: always;
|
|
365
|
+
}
|
|
366
|
+
|
|
321
367
|
/*
|
|
322
368
|
* `Image`'s default `resizeMode`, which is `cover`. `props.ts` paints an image with
|
|
323
369
|
* `background-image` and writes a fit only when `resizeMode` is bound, and `Image` binds it only
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "A browser host for Angular Native: the same components, rendered into the DOM instead of native views.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ng-native/device": "0.
|
|
39
|
-
"@ng-native/fabric": "0.
|
|
38
|
+
"@ng-native/device": "0.11.0",
|
|
39
|
+
"@ng-native/fabric": "0.11.0",
|
|
40
40
|
"@oxc-angular/vite": "0.0.40"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -51,13 +51,14 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@angular/common": "22.2.0",
|
|
53
53
|
"@angular/compiler": "22.2.0",
|
|
54
|
+
"@angular/localize": "22.2.0",
|
|
54
55
|
"@angular/platform-browser": "22.2.0",
|
|
55
56
|
"@ng-icons/core": "^36.0.0",
|
|
56
|
-
"@ng-native/components": "0.
|
|
57
|
-
"@ng-native/icons": "0.
|
|
58
|
-
"@ng-native/metro": "0.
|
|
59
|
-
"@ng-native/tailwind": "0.
|
|
60
|
-
"@ng-native/testing": "0.
|
|
57
|
+
"@ng-native/components": "0.11.0",
|
|
58
|
+
"@ng-native/icons": "0.11.0",
|
|
59
|
+
"@ng-native/metro": "0.11.0",
|
|
60
|
+
"@ng-native/tailwind": "0.11.0",
|
|
61
|
+
"@ng-native/testing": "0.11.0",
|
|
61
62
|
"@tailwindcss/vite": "^4.3.3",
|
|
62
63
|
"@types/jsdom": "^27.0.0",
|
|
63
64
|
"@vitest/browser": "^5.0.2",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"rxjs": "^7.8.2",
|
|
72
73
|
"tailwindcss": "^4.3.3",
|
|
73
74
|
"tailwindcss-v3": "npm:tailwindcss@^3.4.19",
|
|
75
|
+
"typescript": "~6.0.3",
|
|
74
76
|
"vite": "^8.3.1",
|
|
75
77
|
"vitest": "^5.0.2"
|
|
76
78
|
},
|