limber-ui 3.0.0 → 4.0.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/declarations/code.gts.d.ts +90 -0
- package/declarations/code.gts.d.ts.map +1 -0
- package/declarations/{components/frame-messaging.d.ts → frame-messaging.d.ts} +10 -4
- package/declarations/frame-messaging.d.ts.map +1 -0
- package/declarations/index.d.ts +1 -4
- package/declarations/index.d.ts.map +1 -1
- package/dist/code.css +13 -0
- package/dist/index.js +168 -4
- package/dist/index.js.map +1 -1
- package/package.json +35 -60
- package/declarations/components/button.gts.d.ts +0 -23
- package/declarations/components/button.gts.d.ts.map +0 -1
- package/declarations/components/code.gts.d.ts +0 -39
- package/declarations/components/code.gts.d.ts.map +0 -1
- package/declarations/components/external-link.gts.d.ts +0 -15
- package/declarations/components/external-link.gts.d.ts.map +0 -1
- package/declarations/components/frame-messaging.d.ts.map +0 -1
- package/declarations/components/link.gts.d.ts +0 -18
- package/declarations/components/link.gts.d.ts.map +0 -1
- package/dist/components/button.js +0 -30
- package/dist/components/button.js.map +0 -1
- package/dist/components/code.js +0 -51
- package/dist/components/code.js.map +0 -1
- package/dist/components/external-link.js +0 -24
- package/dist/components/external-link.js.map +0 -1
- package/dist/components/frame-messaging.js +0 -56
- package/dist/components/frame-messaging.js.map +0 -1
- package/dist/components/link.js +0 -25
- package/dist/components/link.js.map +0 -1
- package/dist/theme.css +0 -229
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import './code.css';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import type Owner from '@ember/owner';
|
|
4
|
+
type AllowedFormat = 'gjs' | 'gts' | 'hbs' | 'gmd' | 'vue' | 'svelte' | 'mermaid';
|
|
5
|
+
import { HostMessaging } from './frame-messaging.ts';
|
|
6
|
+
interface Signature {
|
|
7
|
+
Element: HTMLIFrameElement;
|
|
8
|
+
Args: {
|
|
9
|
+
/**
|
|
10
|
+
* This is the code that both shows up in the editor and is rendered in the output pane. By default the format is gjs, so the passed code should be written in gjs.
|
|
11
|
+
*/
|
|
12
|
+
code: string;
|
|
13
|
+
/**
|
|
14
|
+
* This is the format that the REPL should both render and load the editor for. The default is "gjs", but valid options are:
|
|
15
|
+
* - gjs
|
|
16
|
+
* - js
|
|
17
|
+
* - gmd
|
|
18
|
+
* - svelte
|
|
19
|
+
* - vue
|
|
20
|
+
* - mermaid
|
|
21
|
+
* - hbs|ember
|
|
22
|
+
* - jsx|react
|
|
23
|
+
*/
|
|
24
|
+
format: AllowedFormat;
|
|
25
|
+
/**
|
|
26
|
+
* Sets the height of the iframe via specifying the number of lines of code to show.
|
|
27
|
+
*/
|
|
28
|
+
lines?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the `title` attribute on the iframe. If `@title` is not passed, this value will be generated for you. Helps with screen readers.
|
|
31
|
+
*/
|
|
32
|
+
title?: string;
|
|
33
|
+
/**
|
|
34
|
+
* By default, the REPL will load when its bounding box approaches the viewport ([via `loading=lazy`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#lazy)). Setting `@clickToLoad` will require user interaction before _rendering_ the iframe.
|
|
35
|
+
*
|
|
36
|
+
* The UI for click to load has stable CSS classes available for customization.
|
|
37
|
+
*
|
|
38
|
+
* - `.limber__code__click-to-load`
|
|
39
|
+
* - `.limber__code__click-to-load__button`
|
|
40
|
+
*/
|
|
41
|
+
clickToLoad?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Where to store in-progress content.
|
|
44
|
+
* by default, the URL will be used -- but for larger documents,
|
|
45
|
+
* local storage may be used instead.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Set the editor size and/or split. For example passing `min` will minimize the editor, and passing `max` will maximize the editor. Also, the percent of the vertical or horizontal direction can be specified as well. For example, passing `60v` will cause a vertical split where the editor takes up 60% of the available space and `30h` will cause a horizontal split where the editor takes up 30% of the available space.
|
|
49
|
+
*/
|
|
50
|
+
editor?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Determines how the editor should load. Normally the editor will load automatically upon detecting interaction activity. This is to optimize page-load as editors can be a few MB when fully featured.
|
|
53
|
+
*
|
|
54
|
+
* Valid options:
|
|
55
|
+
* - "force" - the editor will always load eagerly
|
|
56
|
+
* - "onclick" - the editor will only load when the user clicks that they want to edit the example
|
|
57
|
+
* - "never" - the editor is entirely disabled and the left-hand side is only a highlighted code snippet as is not editable
|
|
58
|
+
*/
|
|
59
|
+
editorLoad?: 'force' | 'onclick' | 'never';
|
|
60
|
+
/**
|
|
61
|
+
* If set to true, the preview code shown before the editor loads will not have highlighting enabled. This option has no affect when the editor is forced to eagerly load.
|
|
62
|
+
*/
|
|
63
|
+
nohighlight?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Sets whether or not the output area should be rendered within a shadow-dom. The default is to render the output in a shadow-dom (true).
|
|
66
|
+
*
|
|
67
|
+
* Changing this can be helpful if importing a library only knows how to mutate the document's head (for styles or otherwise)
|
|
68
|
+
*/
|
|
69
|
+
shadowdom?: boolean;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export default class Code extends Component<Signature> {
|
|
73
|
+
messaging: HostMessaging;
|
|
74
|
+
manualLoad: boolean;
|
|
75
|
+
initialData: Record<string, any>;
|
|
76
|
+
constructor(owner: Owner, args: Signature['Args']);
|
|
77
|
+
get load(): boolean;
|
|
78
|
+
get code(): string;
|
|
79
|
+
get format(): AllowedFormat;
|
|
80
|
+
get lines(): number;
|
|
81
|
+
get title(): string;
|
|
82
|
+
get liveData(): {
|
|
83
|
+
code: string;
|
|
84
|
+
format: AllowedFormat;
|
|
85
|
+
shadowdom: boolean | undefined;
|
|
86
|
+
};
|
|
87
|
+
triggerLoad: () => void;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=code.gts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.gts.d.ts","sourceRoot":"","sources":["../src/code.gts"],"names":[],"mappings":"AAqOA,OAAO,YAAY,CAAC;AAEpB,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAQ3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,KAAK,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAGlF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAWrD,UAAU,SAAS;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE;QACJ;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;;;;;;;;;WAUG;QACH,MAAM,EAAE,aAAa,CAAC;QAEtB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;;;;;;WAOG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QAEtB;;;;WAIG;QAIH;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;;;;;;WAOG;QACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;QAE3C;;WAEG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;QAEtB;;;;WAIG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;CACH;AA+BD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,aAAa,CAAC;IAE7C,UAAU,UAAS;IAE5B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAErB,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;IAajD,IAAI,IAAI,YAMP;IAED,IAAI,IAAI,WAMP;IAED,IAAI,MAAM,kBAMT;IAED,IAAI,KAAK,WAER;IAED,IAAI,KAAK,WAER;IAED,IAAI,QAAQ;;;;MAMX;IAED,WAAW,aAET;CAmDH"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { type Connection } from 'penpal';
|
|
2
1
|
import type { ModifierLike } from '@glint/template';
|
|
2
|
+
import type { Connection } from 'penpal';
|
|
3
|
+
interface ParentToChildData {
|
|
4
|
+
code: string;
|
|
5
|
+
format: string;
|
|
6
|
+
shadowdom: undefined | boolean;
|
|
7
|
+
}
|
|
3
8
|
export declare class HostMessaging {
|
|
4
9
|
frameStatus: unknown;
|
|
5
10
|
connection?: Connection<{
|
|
6
|
-
update: (
|
|
11
|
+
update: (data: ParentToChildData) => void;
|
|
7
12
|
}>;
|
|
8
13
|
/**
|
|
9
14
|
* We can't post right away, because we might do so before the iframe is ready.
|
|
@@ -12,12 +17,13 @@ export declare class HostMessaging {
|
|
|
12
17
|
postMessage: ModifierLike<{
|
|
13
18
|
Element: HTMLIFrameElement;
|
|
14
19
|
Args: {
|
|
15
|
-
Positional: [data:
|
|
20
|
+
Positional: [data: ParentToChildData];
|
|
16
21
|
};
|
|
17
22
|
}>;
|
|
18
23
|
onMessage: ModifierLike<{
|
|
19
24
|
Element: HTMLIFrameElement;
|
|
20
25
|
}>;
|
|
21
|
-
queuePayload(
|
|
26
|
+
queuePayload(data: ParentToChildData): Promise<void>;
|
|
22
27
|
}
|
|
28
|
+
export {};
|
|
23
29
|
//# sourceMappingURL=frame-messaging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-messaging.d.ts","sourceRoot":"","sources":["../src/frame-messaging.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC;CAChC;AAyBD,qBAAa,aAAa;IACf,WAAW,EAAE,OAAO,CAAC;IAE9B,UAAU,CAAC,EAAE,UAAU,CAAC;QACtB,MAAM,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;KAC3C,CAAC,CAAC;IAEH;;;OAGG;IACH,WAAW;iBA7BF,iBAAiB;cACpB;YACJ,UAAU,EAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;SACvC;OA0BiE;IAClE,SAAS;iBAhBgB,iBAAiB;OAyBvC;IAGG,YAAY,CAAC,IAAI,EAAE,iBAAiB;CAY3C"}
|
package/declarations/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { ExternalLink } from "./components/external-link";
|
|
3
|
-
export { Link } from "./components/link";
|
|
4
|
-
export { default as Code, default as EditableCode, default as REPL } from "./components/code";
|
|
1
|
+
export { default as REPL } from "./code";
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/code.css
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.limber__code__click-to-load {
|
|
2
|
+
display: grid;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
border: 1px solid;
|
|
6
|
+
border-radius: 0.5rem;
|
|
7
|
+
padding: 2rem;
|
|
8
|
+
}
|
|
9
|
+
.limber__code__click-to-load__button {
|
|
10
|
+
padding: 1rem 2rem;
|
|
11
|
+
border: 1px solid;
|
|
12
|
+
border-radius: 0.25rem;
|
|
13
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,169 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import "./code.css"
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { on } from '@ember/modifier';
|
|
5
|
+
import { guidFor } from '@ember/object/internals';
|
|
6
|
+
import { htmlSafe } from '@ember/template';
|
|
7
|
+
import { link } from 'reactiveweb/link';
|
|
8
|
+
import { isDestroyed, isDestroying } from '@ember/destroyable';
|
|
9
|
+
import { waitFor, waitForPromise } from '@ember/test-waiters';
|
|
10
|
+
import { modifier } from 'ember-modifier';
|
|
11
|
+
import { connectToChild } from 'penpal';
|
|
12
|
+
import { g, i, n } from 'decorator-transforms/runtime-esm';
|
|
13
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
14
|
+
import { setComponentTemplate } from '@ember/component';
|
|
15
|
+
|
|
16
|
+
;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* We can't post right away, because we might do so before the iframe is ready.
|
|
20
|
+
* We need to wait until the frame initiates contact.
|
|
21
|
+
*/
|
|
22
|
+
function PostMessage(handleUpdate) {
|
|
23
|
+
return modifier((element, [data]) => {
|
|
24
|
+
if (!element.contentWindow) return;
|
|
25
|
+
handleUpdate(data);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function HandleMessage(createConnection) {
|
|
29
|
+
return modifier(element => createConnection(element));
|
|
30
|
+
}
|
|
31
|
+
class HostMessaging {
|
|
32
|
+
static {
|
|
33
|
+
g(this.prototype, "frameStatus", [tracked]);
|
|
34
|
+
}
|
|
35
|
+
#frameStatus = (i(this, "frameStatus"), void 0);
|
|
36
|
+
/**
|
|
37
|
+
* We can't post right away, because we might do so before the iframe is ready.
|
|
38
|
+
* We need to wait until the frame initiates contact.
|
|
39
|
+
*/
|
|
40
|
+
postMessage = PostMessage(data => void this.queuePayload(data));
|
|
41
|
+
onMessage = HandleMessage(element => {
|
|
42
|
+
this.connection = connectToChild({
|
|
43
|
+
iframe: element,
|
|
44
|
+
methods: {}
|
|
45
|
+
});
|
|
46
|
+
waitForPromise(this.connection.promise).catch(console.error);
|
|
47
|
+
return () => void this.connection?.destroy();
|
|
48
|
+
});
|
|
49
|
+
async queuePayload(data) {
|
|
50
|
+
await Promise.resolve();
|
|
51
|
+
if (isDestroyed(this) || isDestroying(this)) return;
|
|
52
|
+
if (!this.connection) return;
|
|
53
|
+
const child = await this.connection.promise;
|
|
54
|
+
if (isDestroyed(this) || isDestroying(this)) return;
|
|
55
|
+
await child.update(data);
|
|
56
|
+
}
|
|
57
|
+
static {
|
|
58
|
+
n(this.prototype, "queuePayload", [waitFor]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
63
|
+
const DEFAULT_DEMO = `
|
|
64
|
+
// Welcome
|
|
65
|
+
//
|
|
66
|
+
// Whatever is export-defaulted is what is rendered
|
|
67
|
+
<template>
|
|
68
|
+
hello world!
|
|
69
|
+
</template>
|
|
70
|
+
`;
|
|
71
|
+
const DEFAULT_NUMBER_OF_LINES = 7;
|
|
72
|
+
const HOST = 'https://limber.glimdown.com/edit';
|
|
73
|
+
/**
|
|
74
|
+
* NOTE: updates the the `src` URL do not update the iframe
|
|
75
|
+
*/
|
|
76
|
+
const INITIAL_URL = options => {
|
|
77
|
+
const {
|
|
78
|
+
code,
|
|
79
|
+
editor,
|
|
80
|
+
shadowdom,
|
|
81
|
+
nohighlight,
|
|
82
|
+
format,
|
|
83
|
+
editorLoad
|
|
84
|
+
} = options;
|
|
85
|
+
const initialQPs = new URLSearchParams(window.location.search);
|
|
86
|
+
const local = initialQPs.get('local');
|
|
87
|
+
const host = initialQPs.has('local') ? `https://localhost:${local || '4201'}/edit` : HOST;
|
|
88
|
+
return `${host}?` + (editorLoad ? `&editorLoad=${editorLoad}` : '') + (editor ? `&editor=${editor}` : '') + (shadowdom ? `&shadowdom=${shadowdom}` : '') + (format ? `&format=${format}` : '&format=BUG:MISSING') + (nohighlight ? `&nohighlight=${nohighlight}` : '') + (local ? `&local` : '') + (code ? `&t=${encodeURIComponent(code)}` : DEFAULT_DEMO);
|
|
89
|
+
};
|
|
90
|
+
function defaultStyle(lines) {
|
|
91
|
+
return `height: calc(1.5rem * ${lines});`;
|
|
92
|
+
}
|
|
93
|
+
class Code extends Component {
|
|
94
|
+
static {
|
|
95
|
+
g(this.prototype, "messaging", [link(HostMessaging)]);
|
|
96
|
+
}
|
|
97
|
+
#messaging = (i(this, "messaging"), void 0);
|
|
98
|
+
static {
|
|
99
|
+
g(this.prototype, "manualLoad", [tracked], function () {
|
|
100
|
+
return false;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
#manualLoad = (i(this, "manualLoad"), void 0);
|
|
104
|
+
initialData;
|
|
105
|
+
constructor(owner, args) {
|
|
106
|
+
super(owner, args);
|
|
107
|
+
this.initialData = {
|
|
108
|
+
editorLoad: this.args.editorLoad,
|
|
109
|
+
editor: this.args.editor,
|
|
110
|
+
nohighlight: this.args.nohighlight,
|
|
111
|
+
shadowdom: this.args.shadowdom,
|
|
112
|
+
code: this.code,
|
|
113
|
+
format: this.format
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
get load() {
|
|
117
|
+
if (this.args.clickToLoad) {
|
|
118
|
+
return this.manualLoad;
|
|
119
|
+
}
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
get code() {
|
|
123
|
+
if ('code' in this.args) {
|
|
124
|
+
return this.args.code;
|
|
125
|
+
}
|
|
126
|
+
return '';
|
|
127
|
+
}
|
|
128
|
+
get format() {
|
|
129
|
+
if ('format' in this.args) {
|
|
130
|
+
return this.args.format ?? 'gjs';
|
|
131
|
+
}
|
|
132
|
+
return 'gjs';
|
|
133
|
+
}
|
|
134
|
+
get lines() {
|
|
135
|
+
return this.args.lines ?? this.code?.split('\n')?.length ?? DEFAULT_NUMBER_OF_LINES;
|
|
136
|
+
}
|
|
137
|
+
get title() {
|
|
138
|
+
return this.args.title ?? guidFor(this.code);
|
|
139
|
+
}
|
|
140
|
+
get liveData() {
|
|
141
|
+
return {
|
|
142
|
+
code: this.code,
|
|
143
|
+
format: this.format,
|
|
144
|
+
shadowdom: this.args.shadowdom
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
triggerLoad = () => {
|
|
148
|
+
this.manualLoad = true;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* This uses iframe postMessage to efficiently update state within the
|
|
152
|
+
* iframe's app so that we don't have to reload the whole app if we want to change the
|
|
153
|
+
* URL / code.
|
|
154
|
+
*/
|
|
155
|
+
static {
|
|
156
|
+
setComponentTemplate(precompileTemplate("\n {{#if this.load}}\n <iframe loading=\"lazy\" data-lines=\"{{this.lines}}\" {{this.messaging.postMessage this.liveData}} {{this.messaging.onMessage}} title={{this.title}} src={{htmlSafe (INITIAL_URL this.initialData)}} style={{htmlSafe (defaultStyle this.lines)}} ...attributes>\n </iframe>\n {{else}}\n <div class=\"limber__code__click-to-load\">\n <button class=\"limber__code__click-to-load__button\" type=\"button\" {{on \"click\" this.triggerLoad}}>\n Click to Load REPL\n </button>\n </div>\n {{/if}}\n ", {
|
|
157
|
+
strictMode: true,
|
|
158
|
+
scope: () => ({
|
|
159
|
+
htmlSafe,
|
|
160
|
+
INITIAL_URL,
|
|
161
|
+
defaultStyle,
|
|
162
|
+
on
|
|
163
|
+
})
|
|
164
|
+
}), this);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export { Code as REPL };
|
|
5
169
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "limber-ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Components for interacting with the Limber REPL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
7
7
|
],
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/NullVoxPopuli/limber.git",
|
|
11
|
-
"directory": "packages/
|
|
11
|
+
"directory": "packages/limber-ui"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "NullVoxPopuli",
|
|
@@ -17,69 +17,49 @@
|
|
|
17
17
|
"dist",
|
|
18
18
|
"declarations"
|
|
19
19
|
],
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"@ember/test-waiters": "^4.0.0",
|
|
22
|
-
"@glimmer/component": "^2.0.0",
|
|
23
|
-
"@glimmer/tracking": "^1.1.2",
|
|
24
|
-
"ember-async-data": "^1.0.3",
|
|
25
|
-
"ember-modifier": "^4.1.0",
|
|
26
|
-
"ember-primitives": ">= 0.11.0",
|
|
27
|
-
"ember-resources": ">= 6.4.2",
|
|
28
|
-
"ember-source": ">= 6.4.0-alpha.3",
|
|
29
|
-
"webpack": ">= 5.92.0"
|
|
30
|
-
},
|
|
31
20
|
"dependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@embroider/addon-shim": "1.
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
38
|
-
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
39
|
-
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
40
|
-
"decorator-transforms": "^2.3.0",
|
|
21
|
+
"@ember/test-waiters": "^4.1.1",
|
|
22
|
+
"@embroider/addon-shim": "1.10.0",
|
|
23
|
+
"@glimmer/component": "^2.0.0",
|
|
24
|
+
"decorator-transforms": "^2.2.2",
|
|
25
|
+
"ember-modifier": "^4.2.2",
|
|
41
26
|
"penpal": "^6.2.2",
|
|
42
|
-
"reactiveweb": "^1.
|
|
27
|
+
"reactiveweb": "^1.9.0"
|
|
43
28
|
},
|
|
44
29
|
"devDependencies": {
|
|
45
|
-
"@babel/core": "^7.
|
|
30
|
+
"@babel/core": "^7.28.3",
|
|
46
31
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
47
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
48
|
-
"@babel/plugin-syntax-decorators": "^7.
|
|
32
|
+
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
33
|
+
"@babel/plugin-syntax-decorators": "^7.27.1",
|
|
49
34
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
50
|
-
"@babel/preset-typescript": "^7.
|
|
51
|
-
"@ember/
|
|
52
|
-
"@embroider/addon-dev": "^
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@glint/
|
|
56
|
-
"@glint/
|
|
57
|
-
"@
|
|
58
|
-
"@glint/template": "1.4.1-unstable.0e0d936",
|
|
59
|
-
"@nullvoxpopuli/eslint-configs": "^5.0.0",
|
|
35
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
36
|
+
"@ember/library-tsconfig": "^1.1.3",
|
|
37
|
+
"@embroider/addon-dev": "^8.1.0",
|
|
38
|
+
"@glint/core": "alpha",
|
|
39
|
+
"@glint/environment-ember-loose": "alpha",
|
|
40
|
+
"@glint/environment-ember-template-imports": "alpha",
|
|
41
|
+
"@glint/template": "alpha",
|
|
42
|
+
"@nullvoxpopuli/eslint-configs": "^5.3.4",
|
|
60
43
|
"@rollup/plugin-babel": "^6.0.4",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"ember-
|
|
65
|
-
"ember-
|
|
66
|
-
"ember-
|
|
67
|
-
"ember-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"ember-template-imports": "^4.3.0",
|
|
71
|
-
"ember-template-lint": "^6.1.0",
|
|
72
|
-
"eslint": "^9.21.0",
|
|
73
|
-
"execa": "^8.0.1",
|
|
44
|
+
"babel-plugin-ember-template-compilation": "^2.4.1",
|
|
45
|
+
"concurrently": "^9.2.1",
|
|
46
|
+
"ember-async-data": "2.0.1",
|
|
47
|
+
"ember-primitives": "^0.40.0",
|
|
48
|
+
"ember-resources": "^7.0.7",
|
|
49
|
+
"ember-source": ">= 6.8.0-alpha.7",
|
|
50
|
+
"ember-template-lint": "^7.9.3",
|
|
51
|
+
"eslint": "^9.34.0",
|
|
52
|
+
"execa": "^9.5.2",
|
|
74
53
|
"fix-bad-declaration-output": "^1.1.4",
|
|
75
|
-
"prettier": "^3.
|
|
76
|
-
"prettier-plugin-ember-template-tag": "2.0
|
|
77
|
-
"rollup": "^4.
|
|
54
|
+
"prettier": "^3.6.2",
|
|
55
|
+
"prettier-plugin-ember-template-tag": "2.1.0",
|
|
56
|
+
"rollup": "^4.50.0",
|
|
78
57
|
"rollup-plugin-copy": "^3.5.0",
|
|
79
|
-
"typescript": "5.
|
|
58
|
+
"typescript": "5.8.3"
|
|
80
59
|
},
|
|
81
60
|
"publishConfig": {
|
|
82
|
-
"registry": "https://registry.npmjs.org"
|
|
61
|
+
"registry": "https://registry.npmjs.org",
|
|
62
|
+
"access": "public"
|
|
83
63
|
},
|
|
84
64
|
"ember": {
|
|
85
65
|
"edition": "octane"
|
|
@@ -102,11 +82,6 @@
|
|
|
102
82
|
"types": "./declarations/index.d.ts",
|
|
103
83
|
"default": "./dist/index.js"
|
|
104
84
|
},
|
|
105
|
-
"./*": {
|
|
106
|
-
"types": "./declarations/*.d.ts",
|
|
107
|
-
"default": "./dist/*"
|
|
108
|
-
},
|
|
109
|
-
"./theme.css": "./dist/theme.css",
|
|
110
85
|
"./addon-main.js": "./addon-main.cjs"
|
|
111
86
|
},
|
|
112
87
|
"volta": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { TOC } from '@ember/component/template-only';
|
|
2
|
-
export declare const Button: TOC<{
|
|
3
|
-
Element: HTMLButtonElement;
|
|
4
|
-
Args: {
|
|
5
|
-
variant?: 'primary' | 'default' | 'secondary';
|
|
6
|
-
};
|
|
7
|
-
Blocks: {
|
|
8
|
-
default: [];
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
export declare const FAB: TOC<{
|
|
12
|
-
Element: HTMLButtonElement;
|
|
13
|
-
Blocks: {
|
|
14
|
-
default: [];
|
|
15
|
-
};
|
|
16
|
-
}>;
|
|
17
|
-
export declare const FlatButton: TOC<{
|
|
18
|
-
Element: HTMLButtonElement;
|
|
19
|
-
Blocks: {
|
|
20
|
-
default: [];
|
|
21
|
-
};
|
|
22
|
-
}>;
|
|
23
|
-
//# sourceMappingURL=button.gts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.gts.d.ts","sourceRoot":"","sources":["../../src/components/button.gts"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAgB1D,eAAO,MAAM,MAAM,EAAE,GAAG,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;KAC/C,CAAC;IACF,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB,CAWC,CAAC;AAEH,eAAO,MAAM,GAAG,EAAE,GAAG,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB,CAWC,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,GAAG,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB,CAWC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
type AllowedFormat = 'gjs' | 'gts' | 'hbs' | 'gmd';
|
|
3
|
-
type Storage = 'local' | 'url';
|
|
4
|
-
import { HostMessaging } from './frame-messaging.ts';
|
|
5
|
-
interface Signature {
|
|
6
|
-
Element: HTMLIFrameElement;
|
|
7
|
-
Args: {
|
|
8
|
-
/**
|
|
9
|
-
* code-snippet to use
|
|
10
|
-
*/
|
|
11
|
-
code: string;
|
|
12
|
-
/**
|
|
13
|
-
* The title of the snippet
|
|
14
|
-
*/
|
|
15
|
-
title?: string;
|
|
16
|
-
/**
|
|
17
|
-
* What kind of file the `code` should be interpreted as.
|
|
18
|
-
*/
|
|
19
|
-
format: AllowedFormat;
|
|
20
|
-
/**
|
|
21
|
-
* Where to store in-progress content.
|
|
22
|
-
* by default, the URL will be used -- but for larger documents,
|
|
23
|
-
* local storage may be used instead.
|
|
24
|
-
*/
|
|
25
|
-
storage?: Storage;
|
|
26
|
-
/**
|
|
27
|
-
* When true, forces the editor to load immediately.
|
|
28
|
-
*/
|
|
29
|
-
editor?: boolean;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export default class Code extends Component<Signature> {
|
|
33
|
-
messaging: HostMessaging;
|
|
34
|
-
get code(): string;
|
|
35
|
-
get lines(): number;
|
|
36
|
-
get title(): string;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=code.gts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code.gts.d.ts","sourceRoot":"","sources":["../../src/components/code.gts"],"names":[],"mappings":"AAiHA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,KAAK,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AACnD,KAAK,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,UAAU,SAAS;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE;QACJ;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,MAAM,EAAE,aAAa,CAAC;QAEtB;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CAyBH;AAmBD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,aAAa,CAAC;IAEtD,IAAI,IAAI,WAMP;IAED,IAAI,KAAK,WAER;IAED,IAAI,KAAK,WAER;CAgBF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { TOC } from '@ember/component/template-only';
|
|
2
|
-
declare const DefaultContent: TOC<{
|
|
3
|
-
Blocks: {
|
|
4
|
-
default: [];
|
|
5
|
-
};
|
|
6
|
-
}>;
|
|
7
|
-
export declare const ExternalLink: TOC<{
|
|
8
|
-
Element: HTMLAnchorElement;
|
|
9
|
-
Blocks: {
|
|
10
|
-
default: [];
|
|
11
|
-
custom: [typeof DefaultContent];
|
|
12
|
-
};
|
|
13
|
-
}>;
|
|
14
|
-
export default ExternalLink;
|
|
15
|
-
//# sourceMappingURL=external-link.gts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"external-link.gts.d.ts","sourceRoot":"","sources":["../../src/components/external-link.gts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAE1D,QAAA,MAAM,cAAc,EAAE,GAAG,CAAC;IAAE,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAA;CAAE,CAWnD,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,GAAG,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;QACZ,MAAM,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC;KACjC,CAAC;CACH,CA4BC,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame-messaging.d.ts","sourceRoot":"","sources":["../../src/components/frame-messaging.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAkB,MAAM,QAAQ,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA2BpD,qBAAa,aAAa;IACf,WAAW,EAAE,OAAO,CAAC;IAE9B,UAAU,CAAC,EAAE,UAAU,CAAC;QACtB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;KAChD,CAAC,CAAC;IAEH;;;OAGG;IACH,WAAW;iBA/BF,iBAAiB;cACpB;YACJ,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;SACnC;OA4BwE;IACzE,SAAS;iBAhBgB,iBAAiB;OAyBvC;IAIG,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAYhD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { TOC } from '@ember/component/template-only';
|
|
2
|
-
export declare const Link: TOC<{
|
|
3
|
-
Element: HTMLAnchorElement | HTMLSpanElement;
|
|
4
|
-
Args: {
|
|
5
|
-
/**
|
|
6
|
-
* Link / Anchor tags can't really be disabled,
|
|
7
|
-
* so we need a another way to communicate that the link is inactive.
|
|
8
|
-
*
|
|
9
|
-
* When `@isDisabled` is true, the anchor will be swapped out with a span
|
|
10
|
-
* but with the same styling (except for communicating that the element is disabled).
|
|
11
|
-
*/
|
|
12
|
-
isDisabled?: boolean;
|
|
13
|
-
};
|
|
14
|
-
Blocks: {
|
|
15
|
-
default: [];
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
//# sourceMappingURL=link.gts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link.gts.d.ts","sourceRoot":"","sources":["../../src/components/link.gts"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAc1D,eAAO,MAAM,IAAI,EAAE,GAAG,CAAC;IACrB,OAAO,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAC7C,IAAI,EAAE;QACJ;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB,CAsBC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
2
|
-
import { setComponentTemplate } from '@ember/component';
|
|
3
|
-
import templateOnly from '@ember/component/template-only';
|
|
4
|
-
|
|
5
|
-
const colorsFor = variant => {
|
|
6
|
-
if (variant === 'default' || variant === undefined) {
|
|
7
|
-
return 'text-white bg-[var(--code-bg)] hover:bg-[var(--code-highlight-bg)]';
|
|
8
|
-
}
|
|
9
|
-
if (variant === 'primary') {
|
|
10
|
-
return 'text-black font-bold bg-[var(--horizon-blue)]';
|
|
11
|
-
}
|
|
12
|
-
if (variant === 'secondary') {
|
|
13
|
-
return 'text-black font-bold bg-[var(--horizon-yellow)]';
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const Button = setComponentTemplate(precompileTemplate("\n <button type=\"button\" class=\"{{colorsFor @variant}}\n inline-block grid grid-flow-col items-center gap-2 rounded border border-[var(--horizon-border)] px-3 py-2 shadow hover:shadow-sm focus:outline-none focus:ring focus-visible:outline-none focus-visible:ring disabled:opacity-30\" ...attributes>\n {{yield}}\n </button>\n", {
|
|
17
|
-
strictMode: true,
|
|
18
|
-
scope: () => ({
|
|
19
|
-
colorsFor
|
|
20
|
-
})
|
|
21
|
-
}), templateOnly());
|
|
22
|
-
const FAB = setComponentTemplate(precompileTemplate("\n <button type=\"button\" class=\"ring-ember-brand grid aspect-square grid-flow-col items-center gap-2 rounded-full border-2 bg-white p-2 text-4xl text-black drop-shadow-2xl hover:bg-[var(--ember-faint-gray)] hover:drop-shadow-xl focus:outline-none focus:ring focus-visible:outline-none focus-visible:ring disabled:opacity-30\" ...attributes>\n {{yield}}\n </button>\n", {
|
|
23
|
-
strictMode: true
|
|
24
|
-
}), templateOnly());
|
|
25
|
-
const FlatButton = setComponentTemplate(precompileTemplate("\n <button type=\"button\" class=\"border-1 ring-ember-brand grid aspect-square grid-flow-col items-center gap-2 rounded-full bg-white p-2 text-2xl text-black hover:bg-[var(--ember-faint-gray)] focus:outline-none focus:ring focus-visible:outline-none focus-visible:ring disabled:opacity-30\" ...attributes>\n {{yield}}\n </button>\n", {
|
|
26
|
-
strictMode: true
|
|
27
|
-
}), templateOnly());
|
|
28
|
-
|
|
29
|
-
export { Button, FAB, FlatButton };
|
|
30
|
-
//# sourceMappingURL=button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../src/components/button.gts"],"sourcesContent":["import type { TOC } from '@ember/component/template-only';\n\nconst colorsFor = (variant: 'primary' | 'default' | 'secondary' | undefined) => {\n if (variant === 'default' || variant === undefined) {\n return 'text-white bg-[var(--code-bg)] hover:bg-[var(--code-highlight-bg)]';\n }\n\n if (variant === 'primary') {\n return 'text-black font-bold bg-[var(--horizon-blue)]';\n }\n\n if (variant === 'secondary') {\n return 'text-black font-bold bg-[var(--horizon-yellow)]';\n }\n};\n\nexport const Button: TOC<{\n Element: HTMLButtonElement;\n Args: {\n variant?: 'primary' | 'default' | 'secondary';\n };\n Blocks: { default: [] };\n}> = <template>\n <button\n type=\"button\"\n class=\"{{colorsFor @variant}}\n inline-block grid grid-flow-col items-center gap-2 rounded border border-[var(--horizon-border)] px-3 py-2 shadow hover:shadow-sm focus:outline-none focus:ring focus-visible:outline-none focus-visible:ring disabled:opacity-30\"\n ...attributes\n >\n {{yield}}\n </button>\n</template>;\n\nexport const FAB: TOC<{\n Element: HTMLButtonElement;\n Blocks: { default: [] };\n}> = <template>\n <button\n type=\"button\"\n class=\"ring-ember-brand grid aspect-square grid-flow-col items-center gap-2 rounded-full border-2 bg-white p-2 text-4xl text-black drop-shadow-2xl hover:bg-[var(--ember-faint-gray)] hover:drop-shadow-xl focus:outline-none focus:ring focus-visible:outline-none focus-visible:ring disabled:opacity-30\"\n ...attributes\n >\n {{yield}}\n </button>\n</template>;\n\nexport const FlatButton: TOC<{\n Element: HTMLButtonElement;\n Blocks: { default: [] };\n}> = <template>\n <button\n type=\"button\"\n class=\"border-1 ring-ember-brand grid aspect-square grid-flow-col items-center gap-2 rounded-full bg-white p-2 text-2xl text-black hover:bg-[var(--ember-faint-gray)] focus:outline-none focus:ring focus-visible:outline-none focus-visible:ring disabled:opacity-30\"\n ...attributes\n >\n {{yield}}\n </button>\n</template>;\n"],"names":["colorsFor","variant","undefined","Button","setComponentTemplate","precompileTemplate","strictMode","scope","templateOnly","FAB","FlatButton"],"mappings":";;;;AAEA,MAAMA,YAAaC,OAAwD,IAAA;AACzE,EAAA,IAAIA,OAAA,KAAY,SAAa,IAAAA,OAAA,KAAYC,SAAW,EAAA;AAClD,IAAA,OAAO,oEAAA;AACT;EAEA,IAAID,YAAY,SAAW,EAAA;AACzB,IAAA,OAAO,+CAAA;AACT;EAEA,IAAIA,YAAY,WAAa,EAAA;AAC3B,IAAA,OAAO,iDAAA;AACT;AACF,CAAA;MAEaE,MAMR,GAAAC,oBAAA,CAAAC,kBAAA,CASL,oVAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAP,IAAAA;AAAA,GAAA;AAAU,CAAE,CAAA,EAAAQ,YAAA,EAAA;MAECC,GAGR,GAAAL,oBAAA,CAAAC,kBAAA,CAQL,wXAAA,EAAA;EAAAC,UAAA,EAAA;AAAU,CAAE,CAAA,EAAAE,YAAA,EAAA;MAECE,UAGR,GAAAN,oBAAA,CAAAC,kBAAA,CAQL,mVAAA,EAAA;EAAAC,UAAA,EAAA;AAAU,CAAE,CAAA,EAAAE,YAAA,EAAA;;;;"}
|
package/dist/components/code.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { guidFor } from '@ember/object/internals';
|
|
3
|
-
import { htmlSafe } from '@ember/template';
|
|
4
|
-
import { link } from 'reactiveweb/link';
|
|
5
|
-
import { HostMessaging } from './frame-messaging.js';
|
|
6
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
|
-
import { setComponentTemplate } from '@ember/component';
|
|
8
|
-
import { g, i } from 'decorator-transforms/runtime';
|
|
9
|
-
|
|
10
|
-
const DEFAULT_NUMBER_OF_LINES = 7;
|
|
11
|
-
// TODO: allow import.meta.env to override this
|
|
12
|
-
let HOST = 'https://limber.glimdown.com/edit';
|
|
13
|
-
const initialQPs = new URLSearchParams(window.location.search);
|
|
14
|
-
if (initialQPs.get('local')) {
|
|
15
|
-
HOST = `http://localhost:${initialQPs.get('local')}`;
|
|
16
|
-
}
|
|
17
|
-
const INITIAL_URL = force => `${HOST}?format=gjs&t=<template></template>` + (force ? `&forceEditor=${force}` : '');
|
|
18
|
-
function defaultStyle(lines) {
|
|
19
|
-
return `height: calc(1.5rem * ${lines});`;
|
|
20
|
-
}
|
|
21
|
-
class Code extends Component {
|
|
22
|
-
static {
|
|
23
|
-
g(this.prototype, "messaging", [link(HostMessaging)]);
|
|
24
|
-
}
|
|
25
|
-
#messaging = (i(this, "messaging"), void 0);
|
|
26
|
-
get code() {
|
|
27
|
-
if ('code' in this.args) {
|
|
28
|
-
return this.args.code;
|
|
29
|
-
}
|
|
30
|
-
return '';
|
|
31
|
-
}
|
|
32
|
-
get lines() {
|
|
33
|
-
return this.code?.split('\n')?.length ?? DEFAULT_NUMBER_OF_LINES;
|
|
34
|
-
}
|
|
35
|
-
get title() {
|
|
36
|
-
return this.args.title ?? guidFor(this.code);
|
|
37
|
-
}
|
|
38
|
-
static {
|
|
39
|
-
setComponentTemplate(precompileTemplate("\n <iframe {{this.messaging.postMessage this.code}} {{this.messaging.onMessage}} title={{this.title}} src={{htmlSafe (INITIAL_URL @editor)}} style={{htmlSafe (defaultStyle this.lines)}} ...attributes>\n </iframe>\n ", {
|
|
40
|
-
strictMode: true,
|
|
41
|
-
scope: () => ({
|
|
42
|
-
htmlSafe,
|
|
43
|
-
INITIAL_URL,
|
|
44
|
-
defaultStyle
|
|
45
|
-
})
|
|
46
|
-
}), this);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { Code as default };
|
|
51
|
-
//# sourceMappingURL=code.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code.js","sources":["../../src/components/code.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { htmlSafe } from '@ember/template';\n\nimport { link } from 'reactiveweb/link';\n\ntype AllowedFormat = 'gjs' | 'gts' | 'hbs' | 'gmd';\ntype Storage = 'local' | 'url';\n\nimport { HostMessaging } from './frame-messaging.ts';\n\ninterface Signature {\n Element: HTMLIFrameElement;\n Args: {\n /**\n * code-snippet to use\n */\n code: string;\n /**\n * The title of the snippet\n */\n title?: string;\n /**\n * What kind of file the `code` should be interpreted as.\n */\n format: AllowedFormat;\n\n /**\n * Where to store in-progress content.\n * by default, the URL will be used -- but for larger documents,\n * local storage may be used instead.\n */\n storage?: Storage;\n\n /**\n * When true, forces the editor to load immediately.\n */\n editor?: boolean;\n };\n /**\n * Example usage:\n *\n * <Code @path=\"templates-how-to/iterate/code/index.gjs\" />\n */\n // | {\n // /**\n // * local path on your asset host for where to load the code snippet file from.\n // * This can be .gjs, .gts, .hbs, or .gmd\n // */\n // path: `${string}.${AllowedFormat}`;\n\n // /**\n // * The title of the snippet\n // */\n // title?: string;\n\n // /**\n // * Where to store in-progress content.\n // * by default, the URL will be used -- but for larger documents,\n // * local storage may be used instead.\n // */\n // storage?: Storage;\n // };\n}\n\nconst DEFAULT_NUMBER_OF_LINES = 7;\n// TODO: allow import.meta.env to override this\nlet HOST = 'https://limber.glimdown.com/edit';\n\nconst initialQPs = new URLSearchParams(window.location.search);\n\nif (initialQPs.get('local')) {\n HOST = `http://localhost:${initialQPs.get('local')}`;\n}\n\nconst INITIAL_URL = (force?: boolean) =>\n `${HOST}?format=gjs&t=<template></template>` + (force ? `&forceEditor=${force}` : '');\n\nfunction defaultStyle(lines: number) {\n return `height: calc(1.5rem * ${lines});`;\n}\n\nexport default class Code extends Component<Signature> {\n @link(HostMessaging) declare messaging: HostMessaging;\n\n get code() {\n if ('code' in this.args) {\n return this.args.code;\n }\n\n return '';\n }\n\n get lines() {\n return this.code?.split('\\n')?.length ?? DEFAULT_NUMBER_OF_LINES;\n }\n\n get title() {\n return this.args.title ?? guidFor(this.code);\n }\n\n <template>\n <iframe\n {{this.messaging.postMessage this.code}}\n {{this.messaging.onMessage}}\n title={{this.title}}\n src={{htmlSafe (INITIAL_URL @editor)}}\n style={{htmlSafe (defaultStyle this.lines)}}\n ...attributes\n >\n </iframe>\n </template>\n}\n"],"names":["DEFAULT_NUMBER_OF_LINES","HOST","initialQPs","URLSearchParams","window","location","search","get","INITIAL_URL","force","defaultStyle","lines","Code","Component","g","prototype","link","HostMessaging","i","void 0","code","args","split","length","title","guidFor","setComponentTemplate","precompileTemplate","strictMode","scope","htmlSafe"],"mappings":";;;;;;;;;AAiEA,MAAMA,uBAA0B,GAAA,CAAA;AAChC;AACA,IAAIC,IAAO,GAAA,kCAAA;AAEX,MAAMC,aAAa,IAAIC,eAAA,CAAgBC,MAAO,CAAAC,QAAQ,CAACC,MAAM,CAAA;AAE7D,IAAIJ,UAAA,CAAWK,GAAG,CAAC,OAAU,CAAA,EAAA;EAC3BN,IAAA,GAAO,oBAAoBC,WAAWK,GAAG,CAAC,SAAU,CAAA;AACtD;AAEA,MAAMC,cAAeC,KAAe,IAClC,GAAGR,IAAK,CAAA,mCAAA,CAAoC,IAAIQ,QAAQ,CAAgBA,aAAAA,EAAAA,KAAM,CAAC,CAAA,GAAG,EAAE,CAAA;AAEtF,SAASC,YAAAA,CAAaC,KAAa,EAAA;EACjC,OAAO,CAAA,sBAAA,EAAyBA,KAAA,CAAS,EAAA,CAAA;AAC3C;AAEe,MAAMC,aAAaC,SAAU,CAAA;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,WAAA,EAAA,CACzCC,IAAK,CAAAC,aAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;EAEN,IAAIC,IAAOA,GAAA;AACT,IAAA,IAAI,MAAU,IAAA,IAAI,CAACC,IAAI,EAAE;AACvB,MAAA,OAAO,IAAI,CAACA,IAAI,CAACD,IAAI;AACvB;AAEA,IAAA,OAAO,EAAA;AACT;EAEA,IAAIT,KAAQA,GAAA;IACV,OAAO,IAAI,CAACS,IAAI,EAAEE,KAAA,CAAM,OAAOC,MAAU,IAAAvB,uBAAA;AAC3C;EAEA,IAAIwB,KAAQA,GAAA;IACV,OAAO,IAAI,CAACH,IAAI,CAACG,KAAK,IAAIC,OAAA,CAAQ,IAAI,CAACL,IAAI,CAAA;AAC7C;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAUA,gOAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,QAAA;QAAAtB,WAAA;AAAAE,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
|
|
2
|
-
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
-
import { ExternalLink as ExternalLink$1 } from 'ember-primitives';
|
|
4
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
|
-
import { setComponentTemplate } from '@ember/component';
|
|
6
|
-
import templateOnly from '@ember/component/template-only';
|
|
7
|
-
|
|
8
|
-
const DefaultContent = setComponentTemplate(precompileTemplate("\n <span>{{yield}}</span>\n\n <FaIcon @icon={{faExternalLinkAlt}} />\n", {
|
|
9
|
-
strictMode: true,
|
|
10
|
-
scope: () => ({
|
|
11
|
-
FaIcon,
|
|
12
|
-
faExternalLinkAlt
|
|
13
|
-
})
|
|
14
|
-
}), templateOnly());
|
|
15
|
-
const ExternalLink = setComponentTemplate(precompileTemplate("\n <PrimitiveExternalLink class=\"inline-flex items-baseline gap-2 rounded-sm hover:underline focus:outline-none focus:ring-4 focus-visible:outline-none\" ...attributes>\n {{#if (has-block)}}\n <DefaultContent>\n {{yield}}\n </DefaultContent>\n {{else if (has-block \"custom\")}}\n {{yield DefaultContent to=\"custom\"}}\n {{/if}}\n </PrimitiveExternalLink>\n", {
|
|
16
|
-
strictMode: true,
|
|
17
|
-
scope: () => ({
|
|
18
|
-
PrimitiveExternalLink: ExternalLink$1,
|
|
19
|
-
DefaultContent
|
|
20
|
-
})
|
|
21
|
-
}), templateOnly());
|
|
22
|
-
|
|
23
|
-
export { ExternalLink, ExternalLink as default };
|
|
24
|
-
//# sourceMappingURL=external-link.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"external-link.js","sources":["../../src/components/external-link.gts"],"sourcesContent":["import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';\nimport { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';\nimport { ExternalLink as PrimitiveExternalLink } from 'ember-primitives';\n\nimport type { TOC } from '@ember/component/template-only';\n\nconst DefaultContent: TOC<{ Blocks: { default: [] } }> = <template>\n <span>{{yield}}</span>\n\n <FaIcon @icon={{faExternalLinkAlt}} />\n</template>;\n\nexport const ExternalLink: TOC<{\n Element: HTMLAnchorElement;\n Blocks: {\n default: [];\n custom: [typeof DefaultContent];\n };\n}> = <template>\n <PrimitiveExternalLink\n class=\"inline-flex items-baseline gap-2 rounded-sm hover:underline focus:outline-none focus:ring-4 focus-visible:outline-none\"\n ...attributes\n >\n {{#if (has-block)}}\n <DefaultContent>\n {{yield}}\n </DefaultContent>\n {{else if (has-block \"custom\")}}\n {{yield DefaultContent to=\"custom\"}}\n {{/if}}\n </PrimitiveExternalLink>\n</template>;\n\nexport default ExternalLink;\n"],"names":["DefaultContent","setComponentTemplate","precompileTemplate","strictMode","scope","FaIcon","faExternalLinkAlt","templateOnly","ExternalLink","PrimitiveExternalLink"],"mappings":";;;;;;;AAMA,MAAMA,cAAmD,GAAAC,oBAAA,CAAAC,kBAAA,CAIzD,0EAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,MAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA,CAAA;MAEGC,YAMR,GAAAP,oBAAA,CAAAC,kBAAA,CAaL,0YAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;2BAAAK,cAAA;AAAAT,IAAAA;AAAA,GAAA;AAAU,CAAE,CAAA,EAAAO,YAAA,EAAA;;;;"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { tracked } from '@glimmer/tracking';
|
|
2
|
-
import { isDestroyed, isDestroying } from '@ember/destroyable';
|
|
3
|
-
import { action } from '@ember/object';
|
|
4
|
-
import { waitFor, waitForPromise } from '@ember/test-waiters';
|
|
5
|
-
import { modifier } from 'ember-modifier';
|
|
6
|
-
import { connectToChild } from 'penpal';
|
|
7
|
-
import { g, i, n } from 'decorator-transforms/runtime';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* We can't post right away, because we might do so before the iframe is ready.
|
|
11
|
-
* We need to wait until the frame initiates contact.
|
|
12
|
-
*/
|
|
13
|
-
function PostMessage(handleUpdate) {
|
|
14
|
-
return modifier((element, [data]) => {
|
|
15
|
-
if (!element.contentWindow) return;
|
|
16
|
-
if (data) {
|
|
17
|
-
handleUpdate(data);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
function HandleMessage(createConnection) {
|
|
22
|
-
return modifier(element => createConnection(element));
|
|
23
|
-
}
|
|
24
|
-
class HostMessaging {
|
|
25
|
-
static {
|
|
26
|
-
g(this.prototype, "frameStatus", [tracked]);
|
|
27
|
-
}
|
|
28
|
-
#frameStatus = (i(this, "frameStatus"), void 0);
|
|
29
|
-
/**
|
|
30
|
-
* We can't post right away, because we might do so before the iframe is ready.
|
|
31
|
-
* We need to wait until the frame initiates contact.
|
|
32
|
-
*/
|
|
33
|
-
postMessage = PostMessage(data => void this.queuePayload('gjs', data));
|
|
34
|
-
onMessage = HandleMessage(element => {
|
|
35
|
-
this.connection = connectToChild({
|
|
36
|
-
iframe: element,
|
|
37
|
-
methods: {}
|
|
38
|
-
});
|
|
39
|
-
waitForPromise(this.connection.promise).catch(console.error);
|
|
40
|
-
return () => void this.connection?.destroy();
|
|
41
|
-
});
|
|
42
|
-
async queuePayload(format, text) {
|
|
43
|
-
await Promise.resolve();
|
|
44
|
-
if (isDestroyed(this) || isDestroying(this)) return;
|
|
45
|
-
if (!this.connection) return;
|
|
46
|
-
const child = await this.connection.promise;
|
|
47
|
-
if (isDestroyed(this) || isDestroying(this)) return;
|
|
48
|
-
await child.update(format, text);
|
|
49
|
-
}
|
|
50
|
-
static {
|
|
51
|
-
n(this.prototype, "queuePayload", [waitFor, action]);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { HostMessaging };
|
|
56
|
-
//# sourceMappingURL=frame-messaging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame-messaging.js","sources":["../../src/components/frame-messaging.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport { isDestroyed, isDestroying } from '@ember/destroyable';\nimport { action } from '@ember/object';\nimport { waitFor, waitForPromise } from '@ember/test-waiters';\n\nimport { modifier } from 'ember-modifier';\nimport { type Connection, connectToChild } from 'penpal';\n\nimport type { ModifierLike } from '@glint/template';\n\n/**\n * We can't post right away, because we might do so before the iframe is ready.\n * We need to wait until the frame initiates contact.\n */\nfunction PostMessage(handleUpdate: (data: string) => void): ModifierLike<{\n Element: HTMLIFrameElement;\n Args: {\n Positional: [data: string | null];\n };\n}> {\n return modifier((element, [data]: [string | null]) => {\n if (!element.contentWindow) return;\n\n if (data) {\n handleUpdate(data);\n }\n });\n}\n\nfunction HandleMessage(\n createConnection: (element: HTMLIFrameElement) => () => void\n): ModifierLike<{ Element: HTMLIFrameElement }> {\n return modifier((element) => createConnection(element));\n}\n\nexport class HostMessaging {\n @tracked frameStatus: unknown;\n\n connection?: Connection<{\n update: (format: string, text: string) => void;\n }>;\n\n /**\n * We can't post right away, because we might do so before the iframe is ready.\n * We need to wait until the frame initiates contact.\n */\n postMessage = PostMessage((data) => void this.queuePayload('gjs', data));\n onMessage = HandleMessage((element) => {\n this.connection = connectToChild({\n iframe: element,\n methods: {},\n });\n\n waitForPromise(this.connection.promise).catch(console.error);\n\n return () => void this.connection?.destroy();\n });\n\n @action\n @waitFor\n async queuePayload(format: string, text: string) {\n await Promise.resolve();\n if (isDestroyed(this) || isDestroying(this)) return;\n\n if (!this.connection) return;\n\n const child = await this.connection.promise;\n\n if (isDestroyed(this) || isDestroying(this)) return;\n\n await child.update(format, text);\n }\n}\n"],"names":["PostMessage","handleUpdate","modifier","element","data","contentWindow","HandleMessage","createConnection","HostMessaging","g","prototype","tracked","i","void 0","postMessage","queuePayload","onMessage","connection","connectToChild","iframe","methods","waitForPromise","promise","catch","console","error","destroy","format","text","Promise","resolve","isDestroyed","isDestroying","child","update","n","waitFor","action"],"mappings":";;;;;;;;AAUA;AACA;AACA;AACA;AACA,SAASA,WAAWA,CAACC,YAAoC,EAKtD;EACD,OAAOC,QAAQ,CAAC,CAACC,OAAO,EAAE,CAACC,IAAI,CAAkB,KAAK;AACpD,IAAA,IAAI,CAACD,OAAO,CAACE,aAAa,EAAE;AAE5B,IAAA,IAAID,IAAI,EAAE;MACRH,YAAY,CAACG,IAAI,CAAC;AACpB;AACF,GAAC,CAAC;AACJ;AAEA,SAASE,aAAaA,CACpBC,gBAA4D,EACd;EAC9C,OAAOL,QAAQ,CAAEC,OAAO,IAAKI,gBAAgB,CAACJ,OAAO,CAAC,CAAC;AACzD;AAEO,MAAMK,aAAa,CAAC;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,aAAA,EAAA,CACxBC,OAAO,CAAA,CAAA;AAAA;AAAA,EAAA,YAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,aAAA,CAAA,EAAAC,MAAA;AAMR;AACF;AACA;AACA;AACEC,EAAAA,WAAW,GAAGd,WAAW,CAAEI,IAAI,IAAK,KAAK,IAAI,CAACW,YAAY,CAAC,KAAK,EAAEX,IAAI,CAAC,CAAC;AACxEY,EAAAA,SAAS,GAAGV,aAAa,CAAEH,OAAO,IAAK;AACrC,IAAA,IAAI,CAACc,UAAU,GAAGC,cAAc,CAAC;AAC/BC,MAAAA,MAAM,EAAEhB,OAAO;AACfiB,MAAAA,OAAO,EAAE;AACX,KAAC,CAAC;AAEFC,IAAAA,cAAc,CAAC,IAAI,CAACJ,UAAU,CAACK,OAAO,CAAC,CAACC,KAAK,CAACC,OAAO,CAACC,KAAK,CAAC;IAE5D,OAAO,MAAM,KAAK,IAAI,CAACR,UAAU,EAAES,OAAO,EAAE;AAC9C,GAAC,CAAC;AAEF,EAAA,MAEMX,YAAYA,CAACY,MAAc,EAAEC,IAAY,EAAE;AAC/C,IAAA,MAAMC,OAAO,CAACC,OAAO,EAAE;IACvB,IAAIC,WAAW,CAAC,IAAI,CAAC,IAAIC,YAAY,CAAC,IAAI,CAAC,EAAE;AAE7C,IAAA,IAAI,CAAC,IAAI,CAACf,UAAU,EAAE;AAEtB,IAAA,MAAMgB,KAAK,GAAG,MAAM,IAAI,CAAChB,UAAU,CAACK,OAAO;IAE3C,IAAIS,WAAW,CAAC,IAAI,CAAC,IAAIC,YAAY,CAAC,IAAI,CAAC,EAAE;AAE7C,IAAA,MAAMC,KAAK,CAACC,MAAM,CAACP,MAAM,EAAEC,IAAI,CAAC;AAClC;AAAC,EAAA;AAAAO,IAAAA,CAAA,CAAAzB,IAAAA,CAAAA,SAAA,EAZA0B,cAAAA,EAAAA,CAAAA,OAAO,EADPC,MAAM,CAAA,CAAA;AAAA;AAcT;;;;"}
|
package/dist/components/link.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { htmlSafe } from '@ember/template';
|
|
2
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
-
import { setComponentTemplate } from '@ember/component';
|
|
4
|
-
import templateOnly from '@ember/component/template-only';
|
|
5
|
-
|
|
6
|
-
const classList = htmlSafe(`
|
|
7
|
-
inline-block items-center grid-flow-col
|
|
8
|
-
text-white rounded bg-[var(--code-bg)]
|
|
9
|
-
px-3 py-2
|
|
10
|
-
border border-[var(--horizon-border)]
|
|
11
|
-
hover:underline
|
|
12
|
-
focus:outline-none focus:ring
|
|
13
|
-
focus-visible:outline-none focus-visible:ring
|
|
14
|
-
shadow
|
|
15
|
-
grid gap-2
|
|
16
|
-
`);
|
|
17
|
-
const Link = setComponentTemplate(precompileTemplate("\n {{#if @isDisabled}}\n\n <span class=\"{{classList}} opacity-30\" ...attributes tabindex=\"0\">\n {{yield}}\n </span>\n\n {{else}}\n\n {{!-- href attribute should be passed in to Link --}}\n {{!-- The lints maybe need a runtime integration. --}}\n {{!-- template-lint-disable link-href-attributes --}}\n <a class={{classList}} ...attributes>\n {{yield}}\n </a>\n\n {{/if}}\n", {
|
|
18
|
-
strictMode: true,
|
|
19
|
-
scope: () => ({
|
|
20
|
-
classList
|
|
21
|
-
})
|
|
22
|
-
}), templateOnly());
|
|
23
|
-
|
|
24
|
-
export { Link };
|
|
25
|
-
//# sourceMappingURL=link.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sources":["../../src/components/link.gts"],"sourcesContent":["import { htmlSafe } from '@ember/template';\n\nimport type { TOC } from '@ember/component/template-only';\n\nconst classList = htmlSafe(`\n inline-block items-center grid-flow-col\n text-white rounded bg-[var(--code-bg)]\n px-3 py-2\n border border-[var(--horizon-border)]\n hover:underline\n focus:outline-none focus:ring\n focus-visible:outline-none focus-visible:ring\n shadow\n grid gap-2\n`);\n\nexport const Link: TOC<{\n Element: HTMLAnchorElement | HTMLSpanElement;\n Args: {\n /**\n * Link / Anchor tags can't really be disabled,\n * so we need a another way to communicate that the link is inactive.\n *\n * When `@isDisabled` is true, the anchor will be swapped out with a span\n * but with the same styling (except for communicating that the element is disabled).\n */\n isDisabled?: boolean;\n };\n Blocks: { default: [] };\n}> = <template>\n {{#if @isDisabled}}\n\n <span class=\"{{classList}} opacity-30\" ...attributes tabindex=\"0\">\n {{yield}}\n </span>\n\n {{else}}\n\n {{! href attribute should be passed in to Link }}\n {{! The lints maybe need a runtime integration. }}\n {{! template-lint-disable link-href-attributes }}\n <a class={{classList}} ...attributes>\n {{yield}}\n </a>\n\n {{/if}}\n</template>;\n"],"names":["classList","htmlSafe","Link","setComponentTemplate","precompileTemplate","strictMode","scope","templateOnly"],"mappings":";;;;;AAIA,MAAMA,SAAA,GAAYC,SAAS;;;;;;;;;;AAU3B,CAAC,CAAA;MAEYC,IAaR,GAAAC,oBAAA,CAAAC,kBAAA,CAiBL,4ZAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAN,IAAAA;AAAA,GAAA;AAAU,CAAE,CAAA,EAAAO,YAAA,EAAA;;;;"}
|
package/dist/theme.css
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
/* @import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500&display=swap"); */
|
|
2
|
-
|
|
3
|
-
/* Horizon Theme https://horizontheme.netlify.app/ */
|
|
4
|
-
:root {
|
|
5
|
-
/* "Dark" */
|
|
6
|
-
--horizon-lavender: #b877db;
|
|
7
|
-
--horizon-turquoise: #25b2bc;
|
|
8
|
-
--horizon-cranberry: #e95678;
|
|
9
|
-
--horizon-apricot: #f09383;
|
|
10
|
-
--horizon-rosebud: #fab795;
|
|
11
|
-
--horizon-tacao: #fac29a;
|
|
12
|
-
|
|
13
|
-
/* "Light" */
|
|
14
|
-
--horizon-amethyst: #8931b9;
|
|
15
|
-
--horizon-elm: #1d8991;
|
|
16
|
-
--horizon-crimson: #da103f;
|
|
17
|
-
--horizon-thunderbird: #dc3318;
|
|
18
|
-
--horizon-tango: #f6661e;
|
|
19
|
-
--horizon-jaffa: #f77d26;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.syntax-dark {
|
|
23
|
-
--horizon-shadow: #16161c;
|
|
24
|
-
--horizon-border: #1a1c23;
|
|
25
|
-
--horizon-background: #1c1e26;
|
|
26
|
-
--horizon-background-alt: #232530;
|
|
27
|
-
--horizon-accent: #2e303e;
|
|
28
|
-
--horizon-accent-alt: #6c6f93;
|
|
29
|
-
--horizon-accent: #e9436f;
|
|
30
|
-
--horizon-secondary-accent-alt: #e95379;
|
|
31
|
-
--horizon-negative: #f43e5c;
|
|
32
|
-
--horizon-positive: #09f7a0;
|
|
33
|
-
--horizon-warning: #27d796;
|
|
34
|
-
--horizon-modifier: #21bfc2;
|
|
35
|
-
--horizon-tertiary-accent: #fab28e;
|
|
36
|
-
|
|
37
|
-
--code-bg: var(--horizon-background-alt);
|
|
38
|
-
--code-variable: var(--horizon-cranberry);
|
|
39
|
-
--code-param: var(--horizon-apricot);
|
|
40
|
-
--code-class: var(--horizon-yellow);
|
|
41
|
-
--code-tag: var(--horizon-accent-alt);
|
|
42
|
-
--code-name: var(--horizon-yellow);
|
|
43
|
-
--code-number: var(--horizon-warning);
|
|
44
|
-
--code-punctuation: #aaa;
|
|
45
|
-
--code-regex: #be4678;
|
|
46
|
-
--code-function: var(--horizon-turquoise);
|
|
47
|
-
--code-builtin: var(--horizon-lavender);
|
|
48
|
-
--code-literal: var(--horizon-cranberry);
|
|
49
|
-
--code-string: var(--horizon-tacao);
|
|
50
|
-
--code-keyword: var(--horizon-lavender);
|
|
51
|
-
--code-highlight-bg: var(--horizon-background);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.syntax-normal {
|
|
55
|
-
--horizon-blue: #26bbd9;
|
|
56
|
-
--horizon-cyan: #59e3e3;
|
|
57
|
-
--horizon-green: #29d398;
|
|
58
|
-
--horizon-magenta: #ee64ae;
|
|
59
|
-
--horizon-red: #e95678;
|
|
60
|
-
--horizon-yellow: #fab795;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.syntax-bright {
|
|
64
|
-
--horizon-blue: #3fc6de;
|
|
65
|
-
--horizon-cyan: #6be6e6;
|
|
66
|
-
--horizon-green: #3fdaa4;
|
|
67
|
-
--horizon-magenta: #f075b7;
|
|
68
|
-
--horizon-red: #ec6a88;
|
|
69
|
-
--horizon-yellow: #fbc3a7;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.syntax-light {
|
|
73
|
-
--horizon-shadow: #16161c;
|
|
74
|
-
--horizon-border: #1a1c23;
|
|
75
|
-
--horizon-background: #fdf0ed;
|
|
76
|
-
--horizon-background-alt: #fadad1;
|
|
77
|
-
--horizon-accent: #f9cbbe;
|
|
78
|
-
--horizon-accent-alt: #f9cec3;
|
|
79
|
-
--horizon-accent: #e73665;
|
|
80
|
-
--horizon-secondary-accent-alt: #e84a72;
|
|
81
|
-
--horizon-negative: #f43e5c;
|
|
82
|
-
--horizon-positive: #07da8c;
|
|
83
|
-
--horizon-warning: #1eb980;
|
|
84
|
-
--horizon-modifier: #1eaeae;
|
|
85
|
-
--horizon-tertiary-accent: #af5427;
|
|
86
|
-
|
|
87
|
-
/* overrides, for readability */
|
|
88
|
-
--horizon-amethyst: #8931b9;
|
|
89
|
-
--horizon-elm: #1d8991;
|
|
90
|
-
--horizon-crimson: #da103f;
|
|
91
|
-
--horizon-thunderbird: #dc3318;
|
|
92
|
-
--horizon-tango: #f6661e;
|
|
93
|
-
|
|
94
|
-
--horizon-blue: #3fc6de;
|
|
95
|
-
--horizon-cyan: #6be6e6;
|
|
96
|
-
--horizon-green: #3fdaa4;
|
|
97
|
-
--horizon-magenta: #f075b7;
|
|
98
|
-
--horizon-red: #ec6a88;
|
|
99
|
-
--horizon-yellow: #bb8367;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.plain-light {
|
|
103
|
-
--code-bg: white;
|
|
104
|
-
--code-variable: var(--horizon-crimson);
|
|
105
|
-
--code-param: var(--horizon-tango);
|
|
106
|
-
--code-class: var(--horizon-yellow);
|
|
107
|
-
--code-tag: var(--horizon-accent-alt);
|
|
108
|
-
--code-name: var(--horizon-crimson);
|
|
109
|
-
--code-number: var(--horizon-accent);
|
|
110
|
-
--code-punctuation: #aaa;
|
|
111
|
-
--code-regex: #be4678;
|
|
112
|
-
--code-function: var(--horizon-turquoise);
|
|
113
|
-
--code-builtin: var(--horizon-lavender);
|
|
114
|
-
--code-literal: var(--horizon-cranberry);
|
|
115
|
-
--code-string: var(--horizon-thunderbird);
|
|
116
|
-
--code-keyword: var(--horizon-amethyst);
|
|
117
|
-
--code-highlight-bg: var(--horizon-background);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.plain-light .hljs-built_in,
|
|
121
|
-
.plain-light .hljs-function {
|
|
122
|
-
font-weight: bold;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.prose pre {
|
|
126
|
-
background: var(--code-bg);
|
|
127
|
-
color: #ccc;
|
|
128
|
-
}
|
|
129
|
-
.prose pre code.hljs,
|
|
130
|
-
.hljs {
|
|
131
|
-
background: var(--code-bg);
|
|
132
|
-
display: block;
|
|
133
|
-
font-family: "Source Code Pro", ui-monospace, monospace, sans-serif;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.hljs-comment {
|
|
137
|
-
color: #777;
|
|
138
|
-
}
|
|
139
|
-
.hljs-quote {
|
|
140
|
-
color: #655f6d;
|
|
141
|
-
}
|
|
142
|
-
.hljs-operator,
|
|
143
|
-
.hljs-punctuation {
|
|
144
|
-
color: var(--code-punctuation);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.hljs-variable,
|
|
148
|
-
.hljs-template-variable {
|
|
149
|
-
color: var(--code-variable);
|
|
150
|
-
}
|
|
151
|
-
.hljs-params {
|
|
152
|
-
color: var(--code-param);
|
|
153
|
-
}
|
|
154
|
-
.hljs-attribute {
|
|
155
|
-
color: var(--code-param);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.hljs-class {
|
|
159
|
-
color: var(--code-class);
|
|
160
|
-
}
|
|
161
|
-
.hljs-tag {
|
|
162
|
-
color: var(--code-tag);
|
|
163
|
-
}
|
|
164
|
-
.hljs-title {
|
|
165
|
-
color: var(--code-name);
|
|
166
|
-
}
|
|
167
|
-
.hljs-name {
|
|
168
|
-
color: var(--code-name);
|
|
169
|
-
}
|
|
170
|
-
.hljs-number {
|
|
171
|
-
color: var(--code-number);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.hljs-regexp,
|
|
175
|
-
.hljs-link,
|
|
176
|
-
.hljs-selector-id,
|
|
177
|
-
.hljs-selector-class {
|
|
178
|
-
color: var(--code-regex);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.hljs-function {
|
|
182
|
-
color: var(--code-function);
|
|
183
|
-
}
|
|
184
|
-
.hljs-built_in,
|
|
185
|
-
.hljs-builtin-name {
|
|
186
|
-
color: var(--code-builtin);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.hljs-meta,
|
|
190
|
-
.hljs-literal,
|
|
191
|
-
.hljs-type {
|
|
192
|
-
color: var(--code-literal);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.hljs-string,
|
|
196
|
-
.hljs-symbol,
|
|
197
|
-
.hljs-code,
|
|
198
|
-
.hljs-bullet {
|
|
199
|
-
color: var(--code-string);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.hljs-keyword,
|
|
203
|
-
.hljs-selector-tag {
|
|
204
|
-
color: var(--code-keyword);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.hljs-section {
|
|
208
|
-
color: var(--horizon-lavender);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.hljs-deletion,
|
|
212
|
-
.hljs-addition {
|
|
213
|
-
color: var(--code-highlight-bg);
|
|
214
|
-
display: inline-block;
|
|
215
|
-
width: 100%;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.hljs-deletion {
|
|
219
|
-
background-color: var(--horizon-negative);
|
|
220
|
-
}
|
|
221
|
-
.hljs-addition {
|
|
222
|
-
background-color: var(--horizon-positive);
|
|
223
|
-
}
|
|
224
|
-
.hljs-emphasis {
|
|
225
|
-
font-style: italic;
|
|
226
|
-
}
|
|
227
|
-
.hljs-strong {
|
|
228
|
-
font-weight: bold;
|
|
229
|
-
}
|