@universal-ember/docs-support 0.9.1 → 0.9.3
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/README.md +0 -1
- package/declarations/errors.d.ts +1 -1
- package/declarations/errors.d.ts.map +1 -1
- package/declarations/index.d.ts +1 -1
- package/declarations/index.d.ts.map +1 -1
- package/declarations/page-layout.d.ts +21 -1
- package/declarations/page-layout.d.ts.map +1 -1
- package/declarations/side-nav.d.ts +0 -2
- package/declarations/side-nav.d.ts.map +1 -1
- package/dist/index-page.css +0 -1
- package/dist/index.js +40 -33
- package/dist/site-css/components.css +0 -1
- package/package.json +20 -18
- package/src/errors.gts +4 -2
- package/src/index-page.css +0 -1
- package/src/index.gts +2 -2
- package/src/page-layout.gts +77 -6
- package/src/side-nav.gts +0 -12
- package/src/site-css/components.css +0 -1
package/README.md
CHANGED
package/declarations/errors.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.gts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAE1D,eAAO,MAAM,SAAS,EAAE,GAAG,CAAC;IAC1B,IAAI,EAAE;QAAE,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;IACrB,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB,CA+BC,CAAC"}
|
package/declarations/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { H2 } from './h2';
|
|
|
5
5
|
export { IndexPage } from './index-page';
|
|
6
6
|
export { InternalLink, Link } from './links';
|
|
7
7
|
export { ResponsiveMenuLayout } from './menu-layout';
|
|
8
|
-
export { PageLayout, TopRight } from './page-layout';
|
|
8
|
+
export { hasReason, PageError, PageLayout, PageLoader, TopRight } from './page-layout';
|
|
9
9
|
export { Shell } from './shell';
|
|
10
10
|
export { Text } from './text';
|
|
11
11
|
export { ThemeToggle } from './theme-toggle';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.gts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.gts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import type { TOC } from '@ember/component/template-only';
|
|
2
|
+
export declare const PageLoader: TOC<{
|
|
3
|
+
Blocks: {
|
|
4
|
+
defaultl: [];
|
|
5
|
+
};
|
|
6
|
+
}>;
|
|
7
|
+
export declare function hasReason(error: unknown): error is {
|
|
8
|
+
reason: string;
|
|
9
|
+
original: Error;
|
|
10
|
+
};
|
|
11
|
+
export declare const PageError: TOC<{
|
|
12
|
+
Args: {
|
|
13
|
+
error: string | {
|
|
14
|
+
reason: string;
|
|
15
|
+
original: Error;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
2
19
|
export declare const PageLayout: TOC<{
|
|
3
20
|
Blocks: {
|
|
4
21
|
logoLink: [];
|
|
5
22
|
topRight: [];
|
|
6
23
|
editLink: [typeof EditLink];
|
|
7
|
-
error: [error: string
|
|
24
|
+
error: [error: string | {
|
|
25
|
+
reason: string;
|
|
26
|
+
original: Error;
|
|
27
|
+
}];
|
|
8
28
|
};
|
|
9
29
|
}>;
|
|
10
30
|
declare const EditLink: TOC<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-layout.d.ts","sourceRoot":"","sources":["../src/page-layout.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-layout.d.ts","sourceRoot":"","sources":["../src/page-layout.gts"],"names":[],"mappings":"AAyNA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AA2B1D,eAAO,MAAM,UAAU,EAAE,GAAG,CAAC;IAC3B,MAAM,EAAE;QACN,QAAQ,EAAE,EAAE,CAAC;KACd,CAAC;CACH,CAgBC,CAAC;AAEH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAA;CAAE,CAOtF;AAED,eAAO,MAAM,SAAS,EAAE,GAAG,CAAC;IAC1B,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,GAAG;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,KAAK,CAAA;SAAE,CAAC;KACrD,CAAC;CACH,CA6BC,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,GAAG,CAAC;IAC3B,MAAM,EAAE;QACN,QAAQ,EAAE,EAAE,CAAC;QACb,QAAQ,EAAE,EAAE,CAAC;QACb,QAAQ,EAAE,CAAC,OAAO,QAAQ,CAAC,CAAC;QAC5B,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,KAAK,CAAA;SAAE,CAAC,CAAC;KAC9D,CAAC;CACH,CAuHC,CAAC;AAEH,QAAA,MAAM,QAAQ,EAAE,GAAG,CAAC;IAAE,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAA;CAAE,CAgBrE,CAAC;AAEH,eAAO,MAAM,QAAQ,EAAE,GAAG,CAAC;IAAE,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAA;CAAE,CAcpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-nav.d.ts","sourceRoot":"","sources":["../src/side-nav.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"side-nav.d.ts","sourceRoot":"","sources":["../src/side-nav.gts"],"names":[],"mappings":"AAkLA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAU3C,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AA0H/D,qBAAa,OAAQ,SAAQ,SAAS,CAAC;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB,CAAC;CACH,CAAC;IAC2B,MAAM,EAAE,aAAa,CAAC;IAEjD,IAAI,OAAO,WAEV;IAED,QAAQ,GAAI,OAAO,KAAK,UAItB;CA2DH"}
|
package/dist/index-page.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-page.css"
|
|
2
1
|
import "./theme-toggle.css"
|
|
2
|
+
import "./index-page.css"
|
|
3
3
|
import "./site-css/site.css"
|
|
4
4
|
import "./site-css/components.css"
|
|
5
5
|
import "./site-css/featured-demo.css"
|
|
@@ -9,7 +9,9 @@ import { precompileTemplate } from '@ember/template-compilation';
|
|
|
9
9
|
import { setComponentTemplate } from '@ember/component';
|
|
10
10
|
import templateOnly from '@ember/component/template-only';
|
|
11
11
|
import { LightBulb, Menu, Sun, Moon } from './icons.js';
|
|
12
|
-
import {
|
|
12
|
+
import { modifier } from 'ember-modifier';
|
|
13
|
+
import { cell } from 'ember-resources';
|
|
14
|
+
import { PageNav, Page } from 'kolay/components';
|
|
13
15
|
import { ExternalLink } from 'ember-primitives/components/external-link';
|
|
14
16
|
import MenuWrapper from 'ember-mobile-menu/components/mobile-menu-wrapper';
|
|
15
17
|
import Component from '@glimmer/component';
|
|
@@ -17,14 +19,11 @@ import { on } from '@ember/modifier';
|
|
|
17
19
|
import { service } from '@ember/service';
|
|
18
20
|
import { sentenceCase } from 'change-case';
|
|
19
21
|
import { link } from 'ember-primitives/helpers';
|
|
20
|
-
import { selected } from 'kolay';
|
|
21
|
-
import { PageNav, Page } from 'kolay/components';
|
|
22
22
|
import { getAnchor } from 'should-handle-link';
|
|
23
23
|
import { g, i } from 'decorator-transforms/runtime';
|
|
24
|
-
import { modifier } from 'ember-modifier';
|
|
25
|
-
import { cell } from 'ember-resources';
|
|
26
24
|
import { Switch } from 'ember-primitives';
|
|
27
25
|
import { colorScheme } from 'ember-primitives/color-scheme';
|
|
26
|
+
import { Hero } from 'ember-primitives/layout/hero';
|
|
28
27
|
import 'ember-mobile-menu/themes/android';
|
|
29
28
|
|
|
30
29
|
/**
|
|
@@ -75,23 +74,6 @@ const Callout = setComponentTemplate(precompileTemplate("<div class=\"flex p-6 m
|
|
|
75
74
|
})
|
|
76
75
|
}), templateOnly());
|
|
77
76
|
|
|
78
|
-
const OopsError = setComponentTemplate(precompileTemplate("<div data-page-error class=\"dark:text-white text:slate-900\" style=\"border: 1px solid red; padding: 1rem; word-break: break-all;\">\n <h1>Oops!</h1><br />\n {{@error}}\n\n <br />\n <br />\n {{yield}}\n</div>", {
|
|
79
|
-
strictMode: true
|
|
80
|
-
}), templateOnly());
|
|
81
|
-
|
|
82
|
-
const H2 = setComponentTemplate(precompileTemplate("<h2 class=\"text-3xl\">{{yield}}</h2>", {
|
|
83
|
-
strictMode: true
|
|
84
|
-
}), templateOnly());
|
|
85
|
-
|
|
86
|
-
;
|
|
87
|
-
|
|
88
|
-
const IndexPage = setComponentTemplate(precompileTemplate("<Hero class=\"shadow-xl shadow-slate-900/5 gradient-background\">\n <header class=\"absolute md:sticky right-0 bottom-0 md:top-0 z-50 p-4 flex items-center\">\n {{yield to=\"header\"}}\n </header>\n\n <div class=\"h-full flex flex-col gap-8 justify-center items-center\">\n <div style=\"width: 66%; margin: 0 auto; transform: translateY(-20%);\" class=\"grid gap-4\">\n <h1 style=\"filter: drop-shadow(3px 5px 0px rgba(0, 0, 0, 0.4));\">\n {{yield to=\"logo\"}}\n </h1>\n <p class=\"italic text-white w-full md:w-1/2 mx-auto\">\n {{yield to=\"tagline\"}}\n </p>\n </div>\n {{yield to=\"callToAction\"}}\n </div>\n</Hero>\n\n{{yield to=\"content\"}}\n\n<hr />\n<footer style=\"padding: 3rem; width: 66%;\" class=\"mx-auto gap-12 flex-wrap flex justify-between\">\n {{yield to=\"footer\"}}\n</footer>", {
|
|
89
|
-
strictMode: true,
|
|
90
|
-
scope: () => ({
|
|
91
|
-
Hero
|
|
92
|
-
})
|
|
93
|
-
}), templateOnly());
|
|
94
|
-
|
|
95
77
|
const linkClasses = `
|
|
96
78
|
text-sm font-semibold
|
|
97
79
|
dark:text-sky-400
|
|
@@ -169,18 +151,10 @@ const SubSectionLink = setComponentTemplate(precompileTemplate("{{#let (link @hr
|
|
|
169
151
|
})
|
|
170
152
|
}), templateOnly());
|
|
171
153
|
class SideNav extends Component {
|
|
172
|
-
get #selected() {
|
|
173
|
-
return selected(this);
|
|
174
|
-
}
|
|
175
154
|
static {
|
|
176
155
|
g(this.prototype, "router", [service('router')]);
|
|
177
156
|
}
|
|
178
157
|
#router = (i(this, "router"), void 0);
|
|
179
|
-
get humanSelected() {
|
|
180
|
-
const path = this.#selected?.path;
|
|
181
|
-
if (!path) return undefined;
|
|
182
|
-
return path.split('/').filter(Boolean).map(titleize).join(' / ');
|
|
183
|
-
}
|
|
184
158
|
get rootUrl() {
|
|
185
159
|
return this.router.rootURL;
|
|
186
160
|
}
|
|
@@ -276,7 +250,19 @@ const onWindowScroll = modifier(() => {
|
|
|
276
250
|
window.removeEventListener('scroll', onScroll);
|
|
277
251
|
};
|
|
278
252
|
});
|
|
279
|
-
const
|
|
253
|
+
const PageLoader = setComponentTemplate(precompileTemplate("<div class=\"loading-page\" role=\"status\">\n {{yield}}\n</div>\n\n<style>\n @keyframes shimmer {\n 0% {\n background-position: -1000px 0;\n }\n 100% {\n background-position: 1000px 0;\n }\n }\n\n .loading-page {\n position: fixed;\n top: 0rem;\n padding: 0.5rem 1rem;\n background: linear-gradient(\n 90deg,\n rgba(40, 40, 50, 0.9),\n rgba(60, 60, 70, 0.9),\n rgba(40, 40, 50, 0.9)\n );\n background-size: 1000px 100%;\n animation: shimmer 2s infinite;\n filter: drop-shadow(0 0.5rem 0.5rem rgba(0, 0, 0, 0.8));\n color: white;\n right: 0;\n width: 100%;\n border-bottom-left-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .loading-page {\n animation: shimmer 10s infinite;\n }\n }\n</style>", {
|
|
254
|
+
strictMode: true
|
|
255
|
+
}), templateOnly());
|
|
256
|
+
function hasReason(error) {
|
|
257
|
+
return typeof error === 'object' && error !== null && 'reason' in error && typeof error.reason === 'string';
|
|
258
|
+
}
|
|
259
|
+
const PageError = setComponentTemplate(precompileTemplate("<div class=\"error\" data-page-error role=\"alert\">\n {{#if (hasReason @error)}}\n {{@error.reason}}\n <details>\n <summary>Original error</summary>\n <pre>{{@error.original.stack}}</pre>\n </details>\n {{else}}\n {{@error}}\n {{/if}}\n</div>", {
|
|
260
|
+
strictMode: true,
|
|
261
|
+
scope: () => ({
|
|
262
|
+
hasReason
|
|
263
|
+
})
|
|
264
|
+
}), templateOnly());
|
|
265
|
+
const PageLayout = setComponentTemplate(precompileTemplate("<ResponsiveMenuLayout>\n <:header as |Toggle|>\n <header class=\"sticky top-0 z-50 transition duration-500 shadow-md shadow-slate-900/5 dark:shadow-none bg-white/95\n {{if isScrolled.current \"dark:bg-slate-900/95 dark:backdrop-blur dark:[@supports(backdrop-filter:blur(0))]:bg-slate-900/75\" \"dark:bg-slate-900/95\"}}\" {{onWindowScroll}}>\n <div class=\"outer-content flex flex-none flex-wrap items-center justify-between py-4\">\n <div class=\"flex mr-6 lg:hidden\">\n <Toggle />\n </div>\n <div class=\"relative flex items-center flex-grow basis-0\">\n <a href=\"/\" aria-label=\"Home page\">\n {{yield to=\"logoLink\"}}\n </a>\n </div>\n {{!--\n If we ever have a search bar\n <div class=\"mr-6 -my-5 sm:mr-8 md:mr-0\">\n input here\n </div>\n --}}\n <TopRight>\n {{yield to=\"topRight\"}}\n </TopRight>\n </div>\n </header>\n </:header>\n <:content>\n <section data-main-scroll-container class=\"flex-auto max-w-2xl min-w-0 py-4 lg:max-w-none\">\n <Article>\n <Page>\n <:pending>\n <PageLoader>\n Loading, Compiling, etc\n </PageLoader>\n </:pending>\n\n <:error as |error|>\n <section>\n {{yield error to=\"error\"}}\n </section>\n </:error>\n\n <:success as |prose|>\n <prose />\n {{(removeLoader)}}\n {{!-- this is probably really bad, and anti-patterny\n but ember doesn't have a good way to have libraries\n tie in to the URL without a bunch of setup -- which is maybe fine?\n needs some experimenting -- there is a bit of a disconnect with\n deriving data from the URL, and the timing of the model hooks.\n It might be possible to have an afterModel hook wait until the page is\n compiled.\n (that's why we have async state, because we're compiling, not loading)\n --}}\n {{resetScroll prose}}\n </:success>\n </Page>\n </Article>\n\n {{#if (has-block \"editLink\")}}\n\n <div class=\"flex justify-end pt-6 mt-12 border-t border-slate-200 dark:border-slate-800\">\n\n {{yield EditLink to=\"editLink\"}}\n </div>\n {{/if}}\n </section>\n </:content>\n\n</ResponsiveMenuLayout>", {
|
|
280
266
|
strictMode: true,
|
|
281
267
|
scope: () => ({
|
|
282
268
|
ResponsiveMenuLayout,
|
|
@@ -285,6 +271,7 @@ const PageLayout = setComponentTemplate(precompileTemplate("<ResponsiveMenuLayou
|
|
|
285
271
|
TopRight,
|
|
286
272
|
Article,
|
|
287
273
|
Page,
|
|
274
|
+
PageLoader,
|
|
288
275
|
removeLoader,
|
|
289
276
|
resetScroll,
|
|
290
277
|
EditLink
|
|
@@ -303,6 +290,26 @@ const TopRight = setComponentTemplate(precompileTemplate("<div class=\"relative
|
|
|
303
290
|
})
|
|
304
291
|
}), templateOnly());
|
|
305
292
|
|
|
293
|
+
const OopsError = setComponentTemplate(precompileTemplate("<div data-page-error class=\"dark:text-white text:slate-900\" style=\"border: 1px solid red; padding: 1rem; word-break: break-all;\">\n <h1>Oops!</h1><br />\n <PageError @error={{@error}} />\n\n <br />\n <br />\n {{yield}}\n</div>", {
|
|
294
|
+
strictMode: true,
|
|
295
|
+
scope: () => ({
|
|
296
|
+
PageError
|
|
297
|
+
})
|
|
298
|
+
}), templateOnly());
|
|
299
|
+
|
|
300
|
+
const H2 = setComponentTemplate(precompileTemplate("<h2 class=\"text-3xl\">{{yield}}</h2>", {
|
|
301
|
+
strictMode: true
|
|
302
|
+
}), templateOnly());
|
|
303
|
+
|
|
304
|
+
;
|
|
305
|
+
|
|
306
|
+
const IndexPage = setComponentTemplate(precompileTemplate("<Hero class=\"shadow-xl shadow-slate-900/5 gradient-background\">\n <header class=\"absolute md:sticky right-0 bottom-0 md:top-0 z-50 p-4 flex items-center\">\n {{yield to=\"header\"}}\n </header>\n\n <div class=\"h-full flex flex-col gap-8 justify-center items-center\">\n <div style=\"width: 66%; margin: 0 auto; transform: translateY(-20%);\" class=\"grid gap-4\">\n <h1 style=\"filter: drop-shadow(3px 5px 0px rgba(0, 0, 0, 0.4));\">\n {{yield to=\"logo\"}}\n </h1>\n <p class=\"italic text-white w-full md:w-1/2 mx-auto\">\n {{yield to=\"tagline\"}}\n </p>\n </div>\n {{yield to=\"callToAction\"}}\n </div>\n</Hero>\n\n{{yield to=\"content\"}}\n\n<hr />\n<footer style=\"padding: 3rem; width: 66%;\" class=\"mx-auto gap-12 flex-wrap flex justify-between\">\n {{yield to=\"footer\"}}\n</footer>", {
|
|
307
|
+
strictMode: true,
|
|
308
|
+
scope: () => ({
|
|
309
|
+
Hero
|
|
310
|
+
})
|
|
311
|
+
}), templateOnly());
|
|
312
|
+
|
|
306
313
|
;
|
|
307
314
|
|
|
308
315
|
;
|
|
@@ -337,5 +344,5 @@ const Text = setComponentTemplate(precompileTemplate("<span class=\"dark:text-wh
|
|
|
337
344
|
strictMode: true
|
|
338
345
|
}), templateOnly());
|
|
339
346
|
|
|
340
|
-
export { Article, Callout, H2, IndexPage, InternalLink, Link, OopsError, PageLayout, ResponsiveMenuLayout, Shell, Text, ThemeToggle, TopRight };
|
|
347
|
+
export { Article, Callout, H2, IndexPage, InternalLink, Link, OopsError, PageError, PageLayout, PageLoader, ResponsiveMenuLayout, Shell, Text, ThemeToggle, TopRight, hasReason };
|
|
341
348
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@universal-ember/docs-support",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "The default blueprint for Embroider v2 addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -41,38 +41,38 @@
|
|
|
41
41
|
"@fontsource/lexend": "^5.2.11",
|
|
42
42
|
"@tailwindcss/typography": "^0.5.15",
|
|
43
43
|
"change-case": "^5.4.4",
|
|
44
|
-
"decorator-transforms": "
|
|
44
|
+
"decorator-transforms": "2.3.1",
|
|
45
45
|
"ember-mobile-menu": "^6.0.0",
|
|
46
|
-
"ember-modifier": "^4.
|
|
46
|
+
"ember-modifier": "^4.3.0",
|
|
47
47
|
"ember-resources": "^7.0.7",
|
|
48
48
|
"inter-ui": "^4.0.2",
|
|
49
|
-
"kolay": "^
|
|
49
|
+
"kolay": "^5.1.2",
|
|
50
50
|
"package-up": "^5.0.0",
|
|
51
51
|
"read-package-up": "^12.0.0",
|
|
52
52
|
"should-handle-link": "^1.2.2",
|
|
53
53
|
"tailwindcss": "^3.4.14",
|
|
54
|
-
"ember-primitives": "0.
|
|
54
|
+
"ember-primitives": "^0.53.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@babel/core": "^7.
|
|
58
|
-
"@babel/plugin-transform-typescript": "^7.28.
|
|
59
|
-
"@babel/runtime": "^7.28.
|
|
57
|
+
"@babel/core": "^7.29.0",
|
|
58
|
+
"@babel/plugin-transform-typescript": "^7.28.6",
|
|
59
|
+
"@babel/runtime": "^7.28.6",
|
|
60
60
|
"@ember/library-tsconfig": "^2.0.0",
|
|
61
|
-
"@embroider/addon-dev": "^8.
|
|
61
|
+
"@embroider/addon-dev": "^8.3.0",
|
|
62
62
|
"@glimmer/component": "^2.0.0",
|
|
63
|
-
"@glint/ember-tsc": "^1.
|
|
64
|
-
"@glint/template": "
|
|
65
|
-
"@glint/tsserver-plugin": "^2.0
|
|
63
|
+
"@glint/ember-tsc": "^1.1.1",
|
|
64
|
+
"@glint/template": "1.7.4",
|
|
65
|
+
"@glint/tsserver-plugin": "^2.1.0",
|
|
66
66
|
"@nullvoxpopuli/eslint-configs": "^5.5.0",
|
|
67
67
|
"@rollup/plugin-babel": "^6.1.0",
|
|
68
|
-
"babel-plugin-ember-template-compilation": "^
|
|
68
|
+
"babel-plugin-ember-template-compilation": "^4.0.0",
|
|
69
69
|
"concurrently": "^9.2.1",
|
|
70
|
-
"ember-source": "^
|
|
70
|
+
"ember-source": "^6.10.1",
|
|
71
71
|
"ember-template-lint": "^7.9.3",
|
|
72
72
|
"eslint": "^9.39.2",
|
|
73
|
-
"prettier": "^3.
|
|
74
|
-
"prettier-plugin-ember-template-tag": "^2.1.
|
|
75
|
-
"rollup": "^4.
|
|
73
|
+
"prettier": "^3.8.1",
|
|
74
|
+
"prettier-plugin-ember-template-tag": "^2.1.3",
|
|
75
|
+
"rollup": "^4.57.1",
|
|
76
76
|
"rollup-plugin-copy": "^3.5.0",
|
|
77
77
|
"typescript": "^5.9.3"
|
|
78
78
|
},
|
|
@@ -92,12 +92,14 @@
|
|
|
92
92
|
"scripts": {
|
|
93
93
|
"build": "rollup --config",
|
|
94
94
|
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
|
|
95
|
-
"lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'",
|
|
95
|
+
"lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:' && pnpm format",
|
|
96
96
|
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
|
|
97
97
|
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
|
|
98
98
|
"lint:js": "eslint . --cache",
|
|
99
99
|
"lint:js:fix": "eslint . --fix",
|
|
100
100
|
"lint:types": "ember-tsc --noEmit",
|
|
101
|
+
"lint:prettier": "prettier --check .",
|
|
102
|
+
"format": "prettier --write .",
|
|
101
103
|
"dev": "rollup --config --watch --no-watch.clearScreen",
|
|
102
104
|
"start": "rollup --config --watch --no-watch.clearScreen"
|
|
103
105
|
}
|
package/src/errors.gts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { PageError } from './page-layout.gts';
|
|
2
|
+
|
|
1
3
|
import type { TOC } from '@ember/component/template-only';
|
|
2
4
|
|
|
3
5
|
export const OopsError: TOC<{
|
|
4
|
-
Args: { error:
|
|
6
|
+
Args: { error: any };
|
|
5
7
|
Blocks: { default: [] };
|
|
6
8
|
}> = <template>
|
|
7
9
|
<div
|
|
@@ -10,7 +12,7 @@ export const OopsError: TOC<{
|
|
|
10
12
|
style="border: 1px solid red; padding: 1rem; word-break: break-all;"
|
|
11
13
|
>
|
|
12
14
|
<h1>Oops!</h1><br />
|
|
13
|
-
{{@error}}
|
|
15
|
+
<PageError @error={{@error}} />
|
|
14
16
|
|
|
15
17
|
<br />
|
|
16
18
|
<br />
|
package/src/index-page.css
CHANGED
package/src/index.gts
CHANGED
|
@@ -3,9 +3,9 @@ export { Callout } from './callout.gts';
|
|
|
3
3
|
export { OopsError } from './errors.gts';
|
|
4
4
|
export { H2 } from './h2.gts';
|
|
5
5
|
export { IndexPage } from './index-page.gts';
|
|
6
|
-
export { InternalLink,Link } from './links.gts';
|
|
6
|
+
export { InternalLink, Link } from './links.gts';
|
|
7
7
|
export { ResponsiveMenuLayout } from './menu-layout.gts';
|
|
8
|
-
export { PageLayout, TopRight } from './page-layout.gts';
|
|
8
|
+
export { hasReason, PageError, PageLayout, PageLoader, TopRight } from './page-layout.gts';
|
|
9
9
|
export { Shell } from './shell.gts';
|
|
10
10
|
export { Text } from './text.gts';
|
|
11
11
|
export { ThemeToggle } from './theme-toggle.gts';
|
package/src/page-layout.gts
CHANGED
|
@@ -15,7 +15,6 @@ function removeLoader() {
|
|
|
15
15
|
document.querySelector('#initial-loader')?.remove();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
function resetScroll(..._args: unknown[]) {
|
|
20
19
|
document.querySelector('html')?.scrollTo(0, 0);
|
|
21
20
|
}
|
|
@@ -35,12 +34,86 @@ const onWindowScroll = modifier(() => {
|
|
|
35
34
|
};
|
|
36
35
|
});
|
|
37
36
|
|
|
37
|
+
export const PageLoader: TOC<{
|
|
38
|
+
Blocks: {
|
|
39
|
+
defaultl: [];
|
|
40
|
+
};
|
|
41
|
+
}> = <template>
|
|
42
|
+
<div class="loading-page" role="status">
|
|
43
|
+
{{yield}}
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<style>
|
|
47
|
+
@keyframes shimmer {
|
|
48
|
+
0% {
|
|
49
|
+
background-position: -1000px 0;
|
|
50
|
+
}
|
|
51
|
+
100% {
|
|
52
|
+
background-position: 1000px 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.loading-page {
|
|
57
|
+
position: fixed;
|
|
58
|
+
top: 0rem;
|
|
59
|
+
padding: 0.5rem 1rem;
|
|
60
|
+
background: linear-gradient(
|
|
61
|
+
90deg,
|
|
62
|
+
rgba(40, 40, 50, 0.9),
|
|
63
|
+
rgba(60, 60, 70, 0.9),
|
|
64
|
+
rgba(40, 40, 50, 0.9)
|
|
65
|
+
);
|
|
66
|
+
background-size: 1000px 100%;
|
|
67
|
+
animation: shimmer 2s infinite;
|
|
68
|
+
filter: drop-shadow(0 0.5rem 0.5rem rgba(0, 0, 0, 0.8));
|
|
69
|
+
color: white;
|
|
70
|
+
right: 0;
|
|
71
|
+
width: 100%;
|
|
72
|
+
border-bottom-left-radius: 0.25rem;
|
|
73
|
+
border-bottom-right-radius: 0.25rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (prefers-reduced-motion: reduce) {
|
|
77
|
+
.loading-page {
|
|
78
|
+
animation: shimmer 10s infinite;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
82
|
+
</template>;
|
|
83
|
+
|
|
84
|
+
export function hasReason(error: unknown): error is { reason: string; original: Error } {
|
|
85
|
+
return (
|
|
86
|
+
typeof error === 'object' &&
|
|
87
|
+
error !== null &&
|
|
88
|
+
'reason' in error &&
|
|
89
|
+
typeof error.reason === 'string'
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const PageError: TOC<{
|
|
94
|
+
Args: {
|
|
95
|
+
error: string | { reason: string; original: Error };
|
|
96
|
+
};
|
|
97
|
+
}> = <template>
|
|
98
|
+
<div class="error" data-page-error role="alert">
|
|
99
|
+
{{#if (hasReason @error)}}
|
|
100
|
+
{{@error.reason}}
|
|
101
|
+
<details>
|
|
102
|
+
<summary>Original error</summary>
|
|
103
|
+
<pre>{{@error.original.stack}}</pre>
|
|
104
|
+
</details>
|
|
105
|
+
{{else}}
|
|
106
|
+
{{@error}}
|
|
107
|
+
{{/if}}
|
|
108
|
+
</div>
|
|
109
|
+
</template>;
|
|
110
|
+
|
|
38
111
|
export const PageLayout: TOC<{
|
|
39
112
|
Blocks: {
|
|
40
113
|
logoLink: [];
|
|
41
114
|
topRight: [];
|
|
42
115
|
editLink: [typeof EditLink];
|
|
43
|
-
error: [error: string];
|
|
116
|
+
error: [error: string | { reason: string; original: Error }];
|
|
44
117
|
};
|
|
45
118
|
}> = <template>
|
|
46
119
|
<ResponsiveMenuLayout>
|
|
@@ -80,11 +153,9 @@ export const PageLayout: TOC<{
|
|
|
80
153
|
<Article>
|
|
81
154
|
<Page>
|
|
82
155
|
<:pending>
|
|
83
|
-
<
|
|
84
|
-
class="fixed top-12 p-4 rounded z-50 transition border border-slate-800 duration-500 shadow-xl shadow-slate-900/5 bg-white/95 'dark:bg-slate-900/95 dark:backdrop-blur dark:[@supports(backdrop-filter:blur(0))]:bg-slate-900/75'"
|
|
85
|
-
>
|
|
156
|
+
<PageLoader>
|
|
86
157
|
Loading, Compiling, etc
|
|
87
|
-
</
|
|
158
|
+
</PageLoader>
|
|
88
159
|
</:pending>
|
|
89
160
|
|
|
90
161
|
<:error as |error|>
|
package/src/side-nav.gts
CHANGED
|
@@ -4,7 +4,6 @@ import { service } from '@ember/service';
|
|
|
4
4
|
|
|
5
5
|
import { sentenceCase } from 'change-case';
|
|
6
6
|
import { link } from 'ember-primitives/helpers';
|
|
7
|
-
import { selected } from 'kolay';
|
|
8
7
|
import { PageNav } from 'kolay/components';
|
|
9
8
|
import { getAnchor } from 'should-handle-link';
|
|
10
9
|
|
|
@@ -125,19 +124,8 @@ export class SideNav extends Component<{
|
|
|
125
124
|
onClick?: () => void;
|
|
126
125
|
};
|
|
127
126
|
}> {
|
|
128
|
-
get #selected() {
|
|
129
|
-
return selected(this);
|
|
130
|
-
}
|
|
131
127
|
@service('router') declare router: RouterService;
|
|
132
128
|
|
|
133
|
-
get humanSelected() {
|
|
134
|
-
const path = this.#selected?.path;
|
|
135
|
-
|
|
136
|
-
if (!path) return undefined;
|
|
137
|
-
|
|
138
|
-
return path.split('/').filter(Boolean).map(titleize).join(' / ');
|
|
139
|
-
}
|
|
140
|
-
|
|
141
129
|
get rootUrl() {
|
|
142
130
|
return this.router.rootURL;
|
|
143
131
|
}
|