@gjsify/storybook-nativescript 0.64.2 → 0.64.3-next.260
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/lib/esm/appearance.js +1 -1
- package/lib/esm/controls.js +1 -1
- package/package.json +11 -10
package/lib/esm/appearance.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{StorybookSettings as e}from"@gjsify/storybook-core";import{Adw as t,NOTIFY_ACTIVE as n,applyAdwaitaNsAccent as r,clearAdwaitaNsAccent as i}from"@gjsify/adwaita-nativescript";import{GridLayout as a,WrapLayout as o}from"@nativescript/core";import{ADW_ACCENT_COLOR_NAMES as s,adwaitaAccentBgColor as c,adwaitaColorScheme as l}from"@gjsify/adwaita-core";const u=`sb-swatch`;var StorybookNsAppearance=class{settings;constructor(){this.settings=new e(()=>l()===`dark`),this.settings.subscribe(()=>this._apply()),this._apply()}_apply(){let e=this.settings.resolvedAccent;e?r(e):i()}};function buildSwatch(e){let t=new a;return t.className=u,t.backgroundColor=c(e),t}function buildAppearanceDialog(e){let r=e.settings,i=new t.PreferencesDialog;i.title=`Appearance`;let a=new t.PreferencesPage,c=new t.PreferencesGroup;c.title=`ACCENT COLOUR`;let l=new t.SwitchRow;l.title=`Use a custom accent colour`,l.subtitle=`Off keeps the default Adwaita blue`,l.active=r.accentMode===`custom`,c.add(l);let d=new o;d.orientation=`horizontal`,d.className=`sb-swatch-row`;let f=new Map;for(let e of s){let t=buildSwatch(e);t.addEventListener(`tap`,()=>{r.accentMode===`custom`&&(r.accent=e)}),f.set(e,t),d.addChild(t)}c.add(d),a.add(c),i.add(a);let sync=()=>{let e=r.accentMode===`custom`;l.active!==e&&(l.active=e),d.opacity=e?1:.4;for(let[e,t]of f)t.className=e===r.accent?`${u} selected`:u};return l.
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{StorybookSettings as e}from"@gjsify/storybook-core";import{Adw as t,NOTIFY_ACTIVE as n,applyAdwaitaNsAccent as r,clearAdwaitaNsAccent as i}from"@gjsify/adwaita-nativescript";import{GridLayout as a,WrapLayout as o}from"@nativescript/core";import{ADW_ACCENT_COLOR_NAMES as s,adwaitaAccentBgColor as c,adwaitaColorScheme as l}from"@gjsify/adwaita-core";const u=`sb-swatch`;var StorybookNsAppearance=class{settings;constructor(){this.settings=new e(()=>l()===`dark`),this.settings.subscribe(()=>this._apply()),this._apply()}_apply(){let e=this.settings.resolvedAccent;e?r(e):i()}};function buildSwatch(e){let t=new a;return t.className=u,t.backgroundColor=c(e),t}function buildAppearanceDialog(e){let r=e.settings,i=new t.PreferencesDialog;i.title=`Appearance`;let a=new t.PreferencesPage,c=new t.PreferencesGroup;c.title=`ACCENT COLOUR`;let l=new t.SwitchRow;l.title=`Use a custom accent colour`,l.subtitle=`Off keeps the default Adwaita blue`,l.active=r.accentMode===`custom`,c.add(l);let d=new o;d.orientation=`horizontal`,d.className=`sb-swatch-row`;let f=new Map;for(let e of s){let t=buildSwatch(e);t.addEventListener(`tap`,()=>{r.accentMode===`custom`&&(r.accent=e)}),f.set(e,t),d.addChild(t)}c.add(d),a.add(c),i.add(a);let sync=()=>{let e=r.accentMode===`custom`;l.active!==e&&(l.active=e),d.opacity=e?1:.4;for(let[e,t]of f)t.className=e===r.accent?`${u} selected`:u};return l.connect(n,e=>{r.accentMode=e.active?`custom`:`system`}),r.subscribe(sync),sync(),i}function installAppearanceDialog(e,t){a.setColumn(t,0),a.setColumnSpan(t,3),a.setRow(t,0),a.setRowSpan(t,3),e.addChild(t)}export{StorybookNsAppearance,buildAppearanceDialog,installAppearanceDialog};
|
package/lib/esm/controls.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{bindControl as e}from"@gjsify/storybook-core";import{Adw as t,AdwSliderRow as n,NOTIFY_ACTIVE as r,NOTIFY_SELECTED as i,NOTIFY_SLIDER_VALUE as a,NOTIFY_TEXT as o,NOTIFY_VALUE as s}from"@gjsify/adwaita-nativescript";function createControlRow(t,n){return e(t,n,c)}const c={text(e){let n=new t.EntryRow;n.title=e;let cb=()=>{};return n.addEventListener(o,e=>cb(e.text)),{node:n,get:()=>n.text??``,set:e=>{n.text=e},onChange:e=>{cb=e}}},color(e,n){let r=new t.EntryRow;r.title=`${e} (hex)`,n&&(r.subtitle=n);let cb=()=>{};return r.addEventListener(o,e=>cb(e.text)),{node:r,get:()=>r.text??``,set:e=>{r.text=e},onChange:e=>{cb=e}}},boolean(e,n){let i=new t.SwitchRow;i.title=e,n&&(i.subtitle=n);let cb=()=>{};return i.
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{bindControl as e}from"@gjsify/storybook-core";import{Adw as t,AdwSliderRow as n,NOTIFY_ACTIVE as r,NOTIFY_SELECTED as i,NOTIFY_SLIDER_VALUE as a,NOTIFY_TEXT as o,NOTIFY_VALUE as s}from"@gjsify/adwaita-nativescript";function createControlRow(t,n){return e(t,n,c)}const c={text(e){let n=new t.EntryRow;n.title=e;let cb=()=>{};return n.addEventListener(o,e=>cb(e.text)),{node:n,get:()=>n.text??``,set:e=>{n.text=e},onChange:e=>{cb=e}}},color(e,n){let r=new t.EntryRow;r.title=`${e} (hex)`,n&&(r.subtitle=n);let cb=()=>{};return r.addEventListener(o,e=>cb(e.text)),{node:r,get:()=>r.text??``,set:e=>{r.text=e},onChange:e=>{cb=e}}},boolean(e,n){let i=new t.SwitchRow;i.title=e,n&&(i.subtitle=n);let cb=()=>{};return i.connect(r,e=>cb(e.active)),{node:i,get:()=>i.active,set:e=>{i.active=e},onChange:e=>{cb=e}}},number(e){return spinRow(e)},range(e){return sliderRow(e)},select(e){let n=e.options??[],r=new t.ComboRow;r.title=label(e),e.description&&(r.subtitle=e.description),r.model=n.map(e=>({label:e.label,value:String(e.value)}));let cb=()=>{};return r.addEventListener(i,e=>cb(e.selected)),{node:r,get:()=>r.selected,set:e=>{r.selected=e},onChange:e=>{cb=e}}}};function spinRow(e){let n=new t.SpinRow;n.title=label(e),e.description&&(n.subtitle=e.description),n.adjustment={lower:e.min??0,upper:e.max??100,stepIncrement:e.step??1};let cb=()=>{};return n.addEventListener(s,e=>cb(e.value)),{node:n,get:()=>n.value,set:e=>{n.value=e},onChange:e=>{cb=e}}}function sliderRow(e){let t=new n;t.title=label(e),t.adjustment={lower:e.min??0,upper:e.max??100,stepIncrement:e.step??1};let cb=()=>{};return t.addEventListener(a,e=>cb(e.value)),{node:t,get:()=>t.value,set:e=>{t.value=e},onChange:e=>{cb=e}}}function label(e){return e.label||e.name}export{createControlRow};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/storybook-nativescript",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.3-next.260",
|
|
4
4
|
"description": "NativeScript renderer for the @gjsify/stories contract — the NS counterpart of @gjsify/storybook (GTK) and @gjsify/adwaita-storybook (browser), built on @gjsify/adwaita-nativescript real native widgets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"gnome"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@gjsify/adwaita-icons": "
|
|
43
|
-
"@gjsify/adwaita-core": "
|
|
44
|
-
"@gjsify/adwaita-nativescript": "
|
|
45
|
-
"@gjsify/devtools-nativescript": "
|
|
46
|
-
"@gjsify/stories": "
|
|
47
|
-
"@gjsify/storybook-core": "
|
|
42
|
+
"@gjsify/adwaita-icons": "0.64.3-next.260",
|
|
43
|
+
"@gjsify/adwaita-core": "0.64.3-next.260",
|
|
44
|
+
"@gjsify/adwaita-nativescript": "0.64.3-next.260",
|
|
45
|
+
"@gjsify/devtools-nativescript": "0.64.3-next.260",
|
|
46
|
+
"@gjsify/stories": "0.64.3-next.260",
|
|
47
|
+
"@gjsify/storybook-core": "0.64.3-next.260"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@nativescript/core": "*"
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@gjsify/cli": "
|
|
59
|
-
"@gjsify/unit": "
|
|
58
|
+
"@gjsify/cli": "0.64.3-next.260",
|
|
59
|
+
"@gjsify/unit": "0.64.3-next.260",
|
|
60
60
|
"@nativescript/types": "~9.0.0",
|
|
61
61
|
"@types/node": "^25.9.2",
|
|
62
62
|
"typescript": "^6.0.3"
|
|
@@ -83,5 +83,6 @@
|
|
|
83
83
|
"bugs": {
|
|
84
84
|
"url": "https://github.com/gjsify/gjsify/issues"
|
|
85
85
|
},
|
|
86
|
-
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/nativescript-bridge/storybook#readme"
|
|
86
|
+
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/nativescript-bridge/storybook#readme",
|
|
87
|
+
"gitHead": "886de21be840429ce043cdbf8195172530e230d4"
|
|
87
88
|
}
|