limber-ui 2.0.0 → 3.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/components/button.gts.d.ts +12 -0
- package/declarations/components/button.gts.d.ts.map +1 -1
- package/declarations/components/external-link.gts.d.ts.map +1 -1
- package/declarations/components/frame-messaging.d.ts.map +1 -1
- package/declarations/index.d.ts +2 -3
- package/declarations/index.d.ts.map +1 -1
- package/dist/components/button.js +8 -2
- package/dist/components/button.js.map +1 -1
- package/dist/components/code.js.map +1 -1
- package/dist/components/external-link.js +5 -3
- package/dist/components/external-link.js.map +1 -1
- package/dist/components/frame-messaging.js +3 -3
- package/dist/components/frame-messaging.js.map +1 -1
- package/dist/components/link.js.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +35 -43
- package/declarations/helpers/service.d.ts +0 -14
- package/declarations/helpers/service.d.ts.map +0 -1
- package/dist/helpers/service.js +0 -15
- package/dist/helpers/service.js.map +0 -1
|
@@ -8,4 +8,16 @@ export declare const Button: TOC<{
|
|
|
8
8
|
default: [];
|
|
9
9
|
};
|
|
10
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
|
+
}>;
|
|
11
23
|
//# sourceMappingURL=button.gts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.gts.d.ts","sourceRoot":"","sources":["../../src/components/button.gts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-link.gts.d.ts","sourceRoot":"","sources":["../../src/components/external-link.gts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
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;
|
|
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"}
|
package/declarations/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { Button } from "./components/button";
|
|
2
|
-
export { default as Code, default as EditableCode, default as REPL } from "./components/code";
|
|
1
|
+
export { Button, FAB, FlatButton } from "./components/button";
|
|
3
2
|
export { ExternalLink } from "./components/external-link";
|
|
4
3
|
export { Link } from "./components/link";
|
|
5
|
-
export {
|
|
4
|
+
export { default as Code, default as EditableCode, default as REPL } from "./components/code";
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,OAAO,IAAI,YAAY,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -13,12 +13,18 @@ const colorsFor = variant => {
|
|
|
13
13
|
return 'text-black font-bold bg-[var(--horizon-yellow)]';
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
const Button = setComponentTemplate(precompileTemplate("\n <button type=\"button\" class=\"{{colorsFor @variant}}\n inline-block
|
|
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
17
|
strictMode: true,
|
|
18
18
|
scope: () => ({
|
|
19
19
|
colorsFor
|
|
20
20
|
})
|
|
21
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());
|
|
22
28
|
|
|
23
|
-
export { Button };
|
|
29
|
+
export { Button, FAB, FlatButton };
|
|
24
30
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../src/components/button.gts"],"sourcesContent":["import
|
|
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;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.js","sources":["../../src/components/code.gts"],"sourcesContent":["import
|
|
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,16 +1,18 @@
|
|
|
1
1
|
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
|
|
2
|
+
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';
|
|
2
3
|
import { ExternalLink as ExternalLink$1 } from 'ember-primitives';
|
|
3
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
5
|
import { setComponentTemplate } from '@ember/component';
|
|
5
6
|
import templateOnly from '@ember/component/template-only';
|
|
6
7
|
|
|
7
|
-
const DefaultContent = setComponentTemplate(precompileTemplate("\n <span>{{yield}}</span>\n\n <FaIcon @icon
|
|
8
|
+
const DefaultContent = setComponentTemplate(precompileTemplate("\n <span>{{yield}}</span>\n\n <FaIcon @icon={{faExternalLinkAlt}} />\n", {
|
|
8
9
|
strictMode: true,
|
|
9
10
|
scope: () => ({
|
|
10
|
-
FaIcon
|
|
11
|
+
FaIcon,
|
|
12
|
+
faExternalLinkAlt
|
|
11
13
|
})
|
|
12
14
|
}), templateOnly());
|
|
13
|
-
const ExternalLink = setComponentTemplate(precompileTemplate("\n <PrimitiveExternalLink class=\"inline-flex gap-2
|
|
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", {
|
|
14
16
|
strictMode: true,
|
|
15
17
|
scope: () => ({
|
|
16
18
|
PrimitiveExternalLink: ExternalLink$1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-link.js","sources":["../../src/components/external-link.gts"],"sourcesContent":["import
|
|
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;;;;"}
|
|
@@ -30,20 +30,20 @@ class HostMessaging {
|
|
|
30
30
|
* We can't post right away, because we might do so before the iframe is ready.
|
|
31
31
|
* We need to wait until the frame initiates contact.
|
|
32
32
|
*/
|
|
33
|
-
postMessage = PostMessage(data => this.queuePayload('gjs', data));
|
|
33
|
+
postMessage = PostMessage(data => void this.queuePayload('gjs', data));
|
|
34
34
|
onMessage = HandleMessage(element => {
|
|
35
35
|
this.connection = connectToChild({
|
|
36
36
|
iframe: element,
|
|
37
37
|
methods: {}
|
|
38
38
|
});
|
|
39
39
|
waitForPromise(this.connection.promise).catch(console.error);
|
|
40
|
-
return () => this.connection?.destroy();
|
|
40
|
+
return () => void this.connection?.destroy();
|
|
41
41
|
});
|
|
42
42
|
async queuePayload(format, text) {
|
|
43
43
|
await Promise.resolve();
|
|
44
44
|
if (isDestroyed(this) || isDestroying(this)) return;
|
|
45
45
|
if (!this.connection) return;
|
|
46
|
-
|
|
46
|
+
const child = await this.connection.promise;
|
|
47
47
|
if (isDestroyed(this) || isDestroying(this)) return;
|
|
48
48
|
await child.update(format, text);
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
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) => 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 () => 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
|
|
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;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sources":["../../src/components/link.gts"],"sourcesContent":["import {
|
|
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/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { Button } from './components/button.js';
|
|
2
|
-
export { default as Code, default as EditableCode, default as REPL } from './components/code.js';
|
|
1
|
+
export { Button, FAB, FlatButton } from './components/button.js';
|
|
3
2
|
export { ExternalLink } from './components/external-link.js';
|
|
4
3
|
export { Link } from './components/link.js';
|
|
5
|
-
export {
|
|
4
|
+
export { default as Code, default as EditableCode, default as REPL } from './components/code.js';
|
|
6
5
|
//# 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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "limber-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "The default blueprint for Embroider v2 addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -18,73 +18,65 @@
|
|
|
18
18
|
"declarations"
|
|
19
19
|
],
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@ember/test-waiters": "^
|
|
21
|
+
"@ember/test-waiters": "^4.0.0",
|
|
22
22
|
"@glimmer/component": "^2.0.0",
|
|
23
23
|
"@glimmer/tracking": "^1.1.2",
|
|
24
24
|
"ember-async-data": "^1.0.3",
|
|
25
25
|
"ember-modifier": "^4.1.0",
|
|
26
26
|
"ember-primitives": ">= 0.11.0",
|
|
27
27
|
"ember-resources": ">= 6.4.2",
|
|
28
|
-
"ember-source": ">=
|
|
28
|
+
"ember-source": ">= 6.4.0-alpha.3",
|
|
29
29
|
"webpack": ">= 5.92.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/runtime": "^7.
|
|
32
|
+
"@babel/runtime": "^7.26.9",
|
|
33
33
|
"@embroider/addon-shim": "1.8.9",
|
|
34
34
|
"@embroider/macros": "1.16.9",
|
|
35
|
-
"@fortawesome/ember-fontawesome": "^
|
|
36
|
-
"@fortawesome/fontawesome-svg-core": "^6.
|
|
37
|
-
"@fortawesome/free-brands-svg-icons": "^6.
|
|
38
|
-
"@fortawesome/free-regular-svg-icons": "^6.
|
|
39
|
-
"@fortawesome/free-solid-svg-icons": "^6.
|
|
35
|
+
"@fortawesome/ember-fontawesome": "^3.0.0",
|
|
36
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
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
40
|
"decorator-transforms": "^2.3.0",
|
|
41
41
|
"penpal": "^6.2.2",
|
|
42
|
-
"reactiveweb": "^1.
|
|
42
|
+
"reactiveweb": "^1.4.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@babel/core": "^7.
|
|
46
|
-
"@babel/eslint-parser": "^7.25.7",
|
|
45
|
+
"@babel/core": "^7.26.9",
|
|
47
46
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
48
|
-
"@babel/plugin-proposal-decorators": "^7.25.
|
|
49
|
-
"@babel/plugin-syntax-decorators": "^7.25.
|
|
50
|
-
"@babel/plugin-transform-typescript": "^7.
|
|
51
|
-
"@babel/preset-typescript": "^7.
|
|
52
|
-
"@ember/test-waiters": "^
|
|
53
|
-
"@embroider/addon-dev": "^
|
|
47
|
+
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
48
|
+
"@babel/plugin-syntax-decorators": "^7.25.9",
|
|
49
|
+
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
50
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
51
|
+
"@ember/test-waiters": "^4.0.0",
|
|
52
|
+
"@embroider/addon-dev": "^7.1.1",
|
|
54
53
|
"@glimmer/component": "^2.0.0",
|
|
55
54
|
"@glimmer/tracking": "^1.1.2",
|
|
56
|
-
"@glint/core": "1.4.1-unstable.
|
|
57
|
-
"@glint/environment-ember-loose": "1.4.1-unstable.
|
|
58
|
-
"@glint/environment-ember-template-imports": "1.4.1-unstable.
|
|
59
|
-
"@glint/template": "1.4.1-unstable.
|
|
60
|
-
"@nullvoxpopuli/eslint-configs": "^
|
|
55
|
+
"@glint/core": "1.4.1-unstable.0e0d936",
|
|
56
|
+
"@glint/environment-ember-loose": "1.4.1-unstable.0e0d936",
|
|
57
|
+
"@glint/environment-ember-template-imports": "1.4.1-unstable.0e0d936",
|
|
58
|
+
"@glint/template": "1.4.1-unstable.0e0d936",
|
|
59
|
+
"@nullvoxpopuli/eslint-configs": "^5.0.0",
|
|
61
60
|
"@rollup/plugin-babel": "^6.0.4",
|
|
62
|
-
"@tsconfig/ember": "^3.0.
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^8.8.0",
|
|
64
|
-
"@typescript-eslint/parser": "^8.8.0",
|
|
61
|
+
"@tsconfig/ember": "^3.0.9",
|
|
65
62
|
"babel-plugin-ember-template-compilation": "^2.3.0",
|
|
66
|
-
"concurrently": "^9.
|
|
63
|
+
"concurrently": "^9.1.2",
|
|
67
64
|
"ember-async-data": "1.0.3",
|
|
68
65
|
"ember-cli-htmlbars": "^6.3.0",
|
|
69
|
-
"ember-modifier": "^4.
|
|
66
|
+
"ember-modifier": "^4.2.0",
|
|
70
67
|
"ember-primitives": "^0.23.1",
|
|
71
|
-
"ember-resources": "^7.0.
|
|
72
|
-
"ember-source": ">=
|
|
73
|
-
"ember-template-imports": "^4.
|
|
74
|
-
"ember-template-lint": "^6.
|
|
75
|
-
"eslint": "^
|
|
76
|
-
"eslint-plugin-ember": "^12.2.1",
|
|
77
|
-
"eslint-plugin-n": "^17.10.3",
|
|
78
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
68
|
+
"ember-resources": "^7.0.3",
|
|
69
|
+
"ember-source": ">= 6.4.0-alpha.3",
|
|
70
|
+
"ember-template-imports": "^4.3.0",
|
|
71
|
+
"ember-template-lint": "^6.1.0",
|
|
72
|
+
"eslint": "^9.21.0",
|
|
79
73
|
"execa": "^8.0.1",
|
|
80
|
-
"fix-bad-declaration-output": "^1.1.
|
|
81
|
-
"prettier": "^3.
|
|
82
|
-
"prettier-plugin-ember-template-tag": "2.0.
|
|
83
|
-
"rollup": "^4.
|
|
74
|
+
"fix-bad-declaration-output": "^1.1.4",
|
|
75
|
+
"prettier": "^3.5.2",
|
|
76
|
+
"prettier-plugin-ember-template-tag": "2.0.4",
|
|
77
|
+
"rollup": "^4.34.8",
|
|
84
78
|
"rollup-plugin-copy": "^3.5.0",
|
|
85
|
-
"typescript": "
|
|
86
|
-
"webpack": ">= 5.92.0",
|
|
87
|
-
"@nullvoxpopuli/limber-untyped": "0.0.1"
|
|
79
|
+
"typescript": "5.7.3"
|
|
88
80
|
},
|
|
89
81
|
"publishConfig": {
|
|
90
82
|
"registry": "https://registry.npmjs.org"
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Helper from '@ember/component/helper';
|
|
2
|
-
import type { Registry } from '@ember/service';
|
|
3
|
-
interface Signature<Key extends keyof Registry> {
|
|
4
|
-
Args: {
|
|
5
|
-
Positional: [Key];
|
|
6
|
-
};
|
|
7
|
-
Return: Registry[Key];
|
|
8
|
-
}
|
|
9
|
-
export default class GetService<Key extends keyof Registry> extends Helper<Signature<Key>> {
|
|
10
|
-
compute([name]: [Key]): Registry[Key];
|
|
11
|
-
}
|
|
12
|
-
export declare const service: typeof GetService;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/helpers/service.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAI7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,UAAU,SAAS,CAAC,GAAG,SAAS,MAAM,QAAQ;IAC5C,IAAI,EAAE;QACJ,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;KACnB,CAAC;IACF,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,GAAG,SAAS,MAAM,QAAQ,CAAE,SAAQ,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACxF,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC;CAOtC;AAED,eAAO,MAAM,OAAO,mBAAa,CAAC"}
|
package/dist/helpers/service.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Helper from '@ember/component/helper';
|
|
2
|
-
import { assert } from '@ember/debug';
|
|
3
|
-
import { getOwner } from '@ember/owner';
|
|
4
|
-
|
|
5
|
-
class GetService extends Helper {
|
|
6
|
-
compute([name]) {
|
|
7
|
-
let owner = getOwner(this);
|
|
8
|
-
assert(`Could not get owner.`, owner);
|
|
9
|
-
return owner.lookup(`service:${name}`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const service = GetService;
|
|
13
|
-
|
|
14
|
-
export { GetService as default, service };
|
|
15
|
-
//# sourceMappingURL=service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sources":["../../src/helpers/service.ts"],"sourcesContent":["import Helper from '@ember/component/helper';\nimport { assert } from '@ember/debug';\nimport { getOwner } from '@ember/owner';\n\nimport type { Registry } from '@ember/service';\n\ninterface Signature<Key extends keyof Registry> {\n Args: {\n Positional: [Key];\n };\n Return: Registry[Key];\n}\n\nexport default class GetService<Key extends keyof Registry> extends Helper<Signature<Key>> {\n compute([name]: [Key]): Registry[Key] {\n let owner = getOwner(this);\n\n assert(`Could not get owner.`, owner);\n\n return owner.lookup(`service:${name}`);\n }\n}\n\nexport const service = GetService;\n"],"names":["GetService","Helper","compute","name","owner","getOwner","assert","lookup","service"],"mappings":";;;;AAae,MAAMA,UAAU,SAAqCC,MAAM,CAAiB;AACzFC,EAAAA,OAAOA,CAAC,CAACC,IAAI,CAAQ,EAAiB;AACpC,IAAA,IAAIC,KAAK,GAAGC,QAAQ,CAAC,IAAI,CAAC;AAE1BC,IAAAA,MAAM,CAAC,CAAA,oBAAA,CAAsB,EAAEF,KAAK,CAAC;AAErC,IAAA,OAAOA,KAAK,CAACG,MAAM,CAAC,CAAWJ,QAAAA,EAAAA,IAAI,EAAE,CAAC;AACxC;AACF;AAEO,MAAMK,OAAO,GAAGR;;;;"}
|