@nonoun/native-playground 0.2.11 → 0.2.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nonoun/native-playground",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "description": "Embeddable live code sandbox for @nonoun/native-ui",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/dist/editors.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export type TabName = 'html' | 'css' | 'js';
2
- export declare const TAB_LABELS: Record<TabName, string>;
3
- export declare function getLanguageExtension(language: TabName): import("@codemirror/language").LanguageSupport;
4
- //# sourceMappingURL=editors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../src/editors.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC;AAE5C,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAA0C,CAAC;AAE1F,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,kDAMrD"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Builds an HTML string for use as iframe `srcdoc` in the playground.
3
- * Renders user code (HTML, CSS, JS) in an isolated iframe with
4
- * native-ui loaded via external CSS and register script URLs.
5
- */
6
- export interface SrcdocOptions {
7
- /** User's HTML from the HTML pane */
8
- html: string;
9
- /** User's CSS from the CSS pane */
10
- css: string;
11
- /** User's JS from the JS pane */
12
- js: string;
13
- /** Pre-resolved framework CSS to inline as <style> (preferred) */
14
- frameworkCss?: string;
15
- /** URL to native-ui.css — fallback when frameworkCss is not available */
16
- cssUrl?: string;
17
- /** URL to native-ui register script (CDN or bundled) */
18
- registerUrl: string;
19
- /** Optional OKLCH token overrides as CSS custom properties */
20
- themeOverrides?: string;
21
- }
22
- export declare function buildSrcdoc(options: SrcdocOptions): string;
23
- //# sourceMappingURL=template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/iframe/template.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAUD,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAoE1D"}
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export { NPlayground } from './playground-element.ts';
2
- export { createPlaygroundStore } from './playground-store.ts';
3
- export type { PlaygroundStore, ConsoleEntry } from './playground-store.ts';
4
- export { getLanguageExtension, TAB_LABELS } from './editors.ts';
5
- export type { TabName } from './editors.ts';
6
- export { buildSrcdoc } from './iframe/template.ts';
7
- export type { SrcdocOptions } from './iframe/template.ts';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG3E,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,45 +0,0 @@
1
- import { NativeElement } from '@nonoun/native-ui';
2
- import '@nonoun/native-codemirror/register';
3
- import type { TabName } from './editors.ts';
4
- /**
5
- * Interactive code playground with live preview.
6
- *
7
- * Renders a tabbed code editor (CodeMirror), a sandboxed iframe preview,
8
- * toolbar controls, and an optional console panel. Content is sourced from
9
- * `<script type="playground/html|css|js">` children at setup time.
10
- *
11
- * @attr {string} orientation - Layout direction: "horizontal" | "vertical" | "auto" (default "auto")
12
- * @attr {boolean} auto-run - Auto-run preview on code changes (default true)
13
- * @attr {number} debounce - Debounce delay in ms for auto-run (default 300)
14
- * @attr {string} active-tab - Active editor tab: "html" | "css" | "js" (default "html")
15
- * @attr {boolean} console-open - Whether the console panel is visible
16
- * @attr {boolean} readonly - Disable editing
17
- * @attr {string} preview-theme - OKLCH token overrides as CSS custom property string
18
- * @attr {string} css-url - URL to native-ui.css for the iframe (required)
19
- * @attr {string} register-url - URL to native-ui register script for the iframe (required)
20
- *
21
- * @fires playground:run - When the preview updates, detail: { html, css, js }
22
- * @fires playground:change - When user edits code, detail: { tab, code }
23
- * @fires playground:copy - When code is copied, detail: { tab, code }
24
- * @fires playground:reset - When code is reset, detail: { html, css, js }
25
- */
26
- export declare class NPlayground extends NativeElement {
27
- #private;
28
- static observedAttributes: string[];
29
- /** Manually trigger a preview update. */
30
- run(): Promise<void>;
31
- /** Reset all code to initial values. */
32
- reset(): void;
33
- /** Get the current code from all three editors. */
34
- getCode(): {
35
- html: string;
36
- css: string;
37
- js: string;
38
- };
39
- /** Programmatically set code in one or more editors. */
40
- setCode(code: Partial<Record<TabName, string>>): void;
41
- attributeChangedCallback(name: string, old: string | null, val: string | null): void;
42
- setup(): void;
43
- teardown(): void;
44
- }
45
- //# sourceMappingURL=playground-element.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playground-element.d.ts","sourceRoot":"","sources":["../src/playground-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuD,MAAM,mBAAmB,CAAC;AAEvG,OAAO,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAK5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAY,SAAQ,aAAa;;IAC5C,MAAM,CAAC,kBAAkB,WAUvB;IAsBF,yCAAyC;IACzC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpB,wCAAwC;IACxC,KAAK,IAAI,IAAI;IAIb,mDAAmD;IACnD,OAAO,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE;IAQpD,wDAAwD;IACxD,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI;IAarD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAqCpF,KAAK,IAAI,IAAI;IA6Fb,QAAQ,IAAI,IAAI;CA2ZjB"}
@@ -1,24 +0,0 @@
1
- import type { Signal } from '@nonoun/native-ui';
2
- export interface ConsoleEntry {
3
- level: 'log' | 'warn' | 'error' | 'clear';
4
- args: string[];
5
- }
6
- export interface PlaygroundStore {
7
- html: Signal<string>;
8
- css: Signal<string>;
9
- js: Signal<string>;
10
- initialHtml: string;
11
- initialCss: string;
12
- initialJs: string;
13
- activeTab: Signal<'html' | 'css' | 'js'>;
14
- consoleOpen: Signal<boolean>;
15
- fullscreen: Signal<boolean>;
16
- orientation: Signal<'horizontal' | 'vertical' | 'auto'>;
17
- autoRun: Signal<boolean>;
18
- debounce: Signal<number>;
19
- readonly: Signal<boolean>;
20
- consoleEntries: Signal<ConsoleEntry[]>;
21
- previewTheme: Signal<string>;
22
- }
23
- export declare function createPlaygroundStore(initialHtml: string, initialCss: string, initialJs: string): PlaygroundStore;
24
- //# sourceMappingURL=playground-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playground-store.d.ts","sourceRoot":"","sources":["../src/playground-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAC1C,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAE9B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAGnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAG1B,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAGvC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,eAAe,CAsBjB"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Register native-playground
3
- *
4
- * Side-effect module that registers the <native-playground> custom element.
5
- *
6
- * Usage:
7
- * import '@nonoun/native-playground/register';
8
- */
9
- export {};
10
- //# sourceMappingURL=register.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}