@gjermundgaraba-designs/simple-rat 0.7.0 → 0.8.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/DESIGN.md +5 -5
- package/dist/highlight/highlight.d.ts.map +1 -1
- package/dist/highlight/highlight.js +66 -115
- package/dist/highlight/vite.d.ts +2 -1
- package/dist/highlight/vite.d.ts.map +1 -1
- package/dist/highlight/vite.js +5 -6
- package/dist/src/code/code.d.ts +4 -4
- package/dist/src/code/code.d.ts.map +1 -1
- package/dist/src/code/code.js +10 -7
- package/dist/src/code/index.d.ts.map +1 -1
- package/dist/src/{codeBlock/codeBlock.d.ts → code-block/code-block.d.ts} +2 -3
- package/dist/src/code-block/code-block.d.ts.map +1 -0
- package/dist/src/{codeBlock/codeBlock.js → code-block/code-block.js} +13 -7
- package/dist/src/code-block/index.d.ts +3 -0
- package/dist/src/code-block/index.d.ts.map +1 -0
- package/dist/src/code-block/index.js +1 -0
- package/dist/src/copy/copy.d.ts.map +1 -1
- package/dist/src/copy/copy.js +1 -7
- package/dist/src/{copyTab/copyTab.d.ts → copy-tab/copy-tab.d.ts} +3 -2
- package/dist/src/copy-tab/copy-tab.d.ts.map +1 -0
- package/dist/src/{copyTab/copyTab.js → copy-tab/copy-tab.js} +13 -13
- package/dist/src/copy-tab/index.d.ts +3 -0
- package/dist/src/copy-tab/index.d.ts.map +1 -0
- package/dist/src/{copyTab → copy-tab}/index.js +1 -1
- package/dist/src/diagram/diagram.d.ts.map +1 -1
- package/dist/src/diagram/index.d.ts.map +1 -1
- package/dist/src/footer/footer.d.ts.map +1 -1
- package/dist/src/footer/index.d.ts.map +1 -1
- package/dist/src/footnotes/footnotes.d.ts.map +1 -1
- package/dist/src/footnotes/footnotes.js +7 -2
- package/dist/src/footnotes/index.d.ts.map +1 -1
- package/dist/src/header/header.d.ts +1 -1
- package/dist/src/header/header.d.ts.map +1 -1
- package/dist/src/header/index.d.ts.map +1 -1
- package/dist/src/heading/heading.d.ts.map +1 -1
- package/dist/src/heading/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +6 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -8
- package/dist/src/nav-link/index.d.ts +3 -0
- package/dist/src/nav-link/index.d.ts.map +1 -0
- package/dist/src/nav-link/index.js +1 -0
- package/dist/src/{navLink/navLink.d.ts → nav-link/nav-link.d.ts} +1 -1
- package/dist/src/nav-link/nav-link.d.ts.map +1 -0
- package/dist/src/{navLink/navLink.js → nav-link/nav-link.js} +1 -1
- package/dist/src/note/index.d.ts.map +1 -1
- package/dist/src/note/note.d.ts.map +1 -1
- package/dist/src/pager/index.d.ts.map +1 -1
- package/dist/src/pager/pager.d.ts.map +1 -1
- package/dist/src/post-list/index.d.ts +3 -0
- package/dist/src/post-list/index.d.ts.map +1 -0
- package/dist/src/post-list/index.js +1 -0
- package/dist/src/{postList/postList.d.ts → post-list/post-list.d.ts} +3 -2
- package/dist/src/post-list/post-list.d.ts.map +1 -0
- package/dist/src/post-list/post-list.js +6 -0
- package/dist/src/post-meta/index.d.ts +3 -0
- package/dist/src/post-meta/index.d.ts.map +1 -0
- package/dist/src/post-meta/index.js +1 -0
- package/dist/src/{postMeta/postMeta.d.ts → post-meta/post-meta.d.ts} +1 -1
- package/dist/src/post-meta/post-meta.d.ts.map +1 -0
- package/dist/src/{postMeta/postMeta.js → post-meta/post-meta.js} +3 -3
- package/dist/src/scheme/index.d.ts +1 -1
- package/dist/src/scheme/index.d.ts.map +1 -1
- package/dist/src/scheme/index.js +1 -1
- package/dist/src/scheme/{schemeSwitch.d.ts → scheme-switch.d.ts} +3 -2
- package/dist/src/scheme/scheme-switch.d.ts.map +1 -0
- package/dist/src/scheme/{schemeSwitch.js → scheme-switch.js} +7 -5
- package/dist/src/scheme/scheme.d.ts +0 -2
- package/dist/src/scheme/scheme.d.ts.map +1 -1
- package/dist/src/scheme/scheme.js +0 -2
- package/dist/src/scheme/switch.d.ts.map +1 -1
- package/dist/src/scheme/switch.js +12 -17
- package/dist/src/scrolls/scrolls.d.ts.map +1 -1
- package/dist/src/scrolls/scrolls.js +7 -9
- package/dist/src/skip-link/index.d.ts +2 -0
- package/dist/src/skip-link/index.d.ts.map +1 -0
- package/dist/src/skip-link/index.js +1 -0
- package/dist/src/{skipLink/skipLink.d.ts → skip-link/skip-link.d.ts} +1 -1
- package/dist/src/skip-link/skip-link.d.ts.map +1 -0
- package/dist/src/{skipLink/skipLink.js → skip-link/skip-link.js} +1 -1
- package/dist/src/table/index.d.ts.map +1 -1
- package/dist/src/table/table.d.ts +1 -1
- package/dist/src/table/table.d.ts.map +1 -1
- package/dist/src/table/table.js +3 -1
- package/highlight/highlight.ts +88 -118
- package/highlight/vite.ts +20 -10
- package/package.json +15 -16
- package/src/code/code.ts +18 -11
- package/src/code/index.ts +1 -0
- package/src/code/lines.d.ts +0 -5
- package/src/{codeBlock/codeBlock.ts → code-block/code-block.ts} +32 -14
- package/src/code-block/index.ts +3 -0
- package/src/copy/copy.ts +8 -17
- package/src/{copyTab/copyTab.ts → copy-tab/copy-tab.ts} +24 -8
- package/src/copy-tab/index.ts +12 -0
- package/src/diagram/diagram.ts +8 -4
- package/src/diagram/index.ts +1 -0
- package/src/footer/footer.ts +4 -2
- package/src/footer/index.ts +1 -0
- package/src/footnotes/footnotes.ts +26 -8
- package/src/footnotes/index.ts +1 -0
- package/src/header/header.ts +8 -5
- package/src/header/index.ts +1 -0
- package/src/heading/heading.ts +10 -2
- package/src/heading/index.ts +1 -0
- package/src/index.ts +23 -8
- package/src/nav-link/index.ts +3 -0
- package/src/{navLink/navLink.ts → nav-link/nav-link.ts} +14 -4
- package/src/note/index.ts +1 -0
- package/src/note/note.ts +6 -2
- package/src/pager/index.ts +1 -0
- package/src/pager/pager.ts +6 -2
- package/src/post-list/index.ts +3 -0
- package/src/post-list/post-list.ts +30 -0
- package/src/post-meta/index.ts +3 -0
- package/src/{postMeta/postMeta.ts → post-meta/post-meta.ts} +5 -2
- package/src/scheme/index.ts +3 -1
- package/src/scheme/{schemeSwitch.ts → scheme-switch.ts} +20 -8
- package/src/scheme/scheme.ts +3 -4
- package/src/scheme/switch.ts +9 -20
- package/src/scrolls/scrolls.ts +19 -13
- package/src/simple-rat.css +0 -47
- package/src/skip-link/index.ts +1 -0
- package/src/table/index.ts +1 -0
- package/src/table/table.ts +18 -9
- package/src/tokens.css +23 -32
- package/dist/src/codeBlock/codeBlock.d.ts.map +0 -1
- package/dist/src/codeBlock/index.d.ts +0 -3
- package/dist/src/codeBlock/index.d.ts.map +0 -1
- package/dist/src/codeBlock/index.js +0 -1
- package/dist/src/copyTab/copyTab.d.ts.map +0 -1
- package/dist/src/copyTab/index.d.ts +0 -3
- package/dist/src/copyTab/index.d.ts.map +0 -1
- package/dist/src/navLink/index.d.ts +0 -3
- package/dist/src/navLink/index.d.ts.map +0 -1
- package/dist/src/navLink/index.js +0 -1
- package/dist/src/navLink/navLink.d.ts.map +0 -1
- package/dist/src/postList/index.d.ts +0 -3
- package/dist/src/postList/index.d.ts.map +0 -1
- package/dist/src/postList/index.js +0 -1
- package/dist/src/postList/postList.d.ts.map +0 -1
- package/dist/src/postList/postList.js +0 -3
- package/dist/src/postMeta/index.d.ts +0 -3
- package/dist/src/postMeta/index.d.ts.map +0 -1
- package/dist/src/postMeta/index.js +0 -1
- package/dist/src/postMeta/postMeta.d.ts.map +0 -1
- package/dist/src/scheme/schemeSwitch.d.ts.map +0 -1
- package/dist/src/skipLink/index.d.ts +0 -2
- package/dist/src/skipLink/index.d.ts.map +0 -1
- package/dist/src/skipLink/index.js +0 -1
- package/dist/src/skipLink/skipLink.d.ts.map +0 -1
- package/src/codeBlock/index.ts +0 -2
- package/src/copyTab/index.ts +0 -2
- package/src/navLink/index.ts +0 -2
- package/src/postList/index.ts +0 -2
- package/src/postList/postList.ts +0 -19
- package/src/postMeta/index.ts +0 -2
- package/src/skipLink/index.ts +0 -1
- /package/src/{skipLink/skipLink.ts → skip-link/skip-link.ts} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
/** A superscript number that jumps to the note numbered `noteNumber`; the note links back. */
|
|
3
|
-
export const refView = (noteNumber, h) => __foldkitBrandViewResult((h.sup([], [
|
|
3
|
+
export const refView = (noteNumber, h) => __foldkitBrandViewResult((h.sup([], [
|
|
4
|
+
h.a([h.Href(`#fn-${noteNumber}`), h.Id(`ref-${noteNumber}`)], [`${noteNumber}`]),
|
|
5
|
+
])), "@gjermundgaraba-designs/simple-rat/src/footnotes/footnotes.js#refView");
|
|
4
6
|
/** The notes, numbered from 1, at the end of the page under a rule. Each ends in a `Back`
|
|
5
7
|
link named for the reference it returns to. */
|
|
6
8
|
export const view = (config, h) => __foldkitBrandViewResult((h.section([h.Class("footnotes"), h.AriaLabel("Footnotes")], [
|
|
@@ -10,7 +12,10 @@ export const view = (config, h) => __foldkitBrandViewResult((h.section([h.Class(
|
|
|
10
12
|
return __foldkitBrandViewResult((h.li([h.Id(`fn-${noteNumber}`)], [
|
|
11
13
|
...note,
|
|
12
14
|
" ",
|
|
13
|
-
h.a([
|
|
15
|
+
h.a([
|
|
16
|
+
h.Href(`#ref-${noteNumber}`),
|
|
17
|
+
h.AriaLabel(`Back to reference ${noteNumber}`),
|
|
18
|
+
], ["Back"]),
|
|
14
19
|
])), "@gjermundgaraba-designs/simple-rat/src/footnotes/footnotes.js#anonymous");
|
|
15
20
|
})),
|
|
16
21
|
])), "@gjermundgaraba-designs/simple-rat/src/footnotes/footnotes.js#view");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/footnotes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/footnotes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE/C,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { Html, HtmlBuilder } from "foldkit/html";
|
|
|
2
2
|
/** Configuration for rendering the header with `view`. */
|
|
3
3
|
export type ViewConfig = Readonly<{
|
|
4
4
|
/** `NavLink`s, and optionally a `SchemeSwitch` last. */
|
|
5
|
-
items:
|
|
5
|
+
items: readonly Html[];
|
|
6
6
|
}>;
|
|
7
7
|
/** The page's header: a nav named "Primary navigation", a line of lowercase links separated
|
|
8
8
|
by middots, then a rule. Each item after the first sits in a `span` with its middot, so a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/header/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,wDAAwD;IACxD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/header/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,wDAAwD;IACxD,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;CACxB,CAAC,CAAC;AAEH;;oEAEoE;AACpE,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAYA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/heading/heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH;oBACoB;AACpB,eAAO,MAAM,IAAI,GAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/heading/heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH;oBACoB;AACpB,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAaF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/heading/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/heading/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export * as Code from "./code/index.ts";
|
|
2
|
-
export * as CodeBlock from "./
|
|
3
|
-
export * as CopyTab from "./
|
|
2
|
+
export * as CodeBlock from "./code-block/index.ts";
|
|
3
|
+
export * as CopyTab from "./copy-tab/index.ts";
|
|
4
4
|
export * as Diagram from "./diagram/index.ts";
|
|
5
5
|
export * as Footer from "./footer/index.ts";
|
|
6
6
|
export * as Footnotes from "./footnotes/index.ts";
|
|
7
7
|
export * as Header from "./header/index.ts";
|
|
8
8
|
export * as Heading from "./heading/index.ts";
|
|
9
|
-
export * as NavLink from "./
|
|
9
|
+
export * as NavLink from "./nav-link/index.ts";
|
|
10
10
|
export * as Note from "./note/index.ts";
|
|
11
11
|
export * as Pager from "./pager/index.ts";
|
|
12
|
-
export * as PostList from "./
|
|
13
|
-
export * as PostMeta from "./
|
|
12
|
+
export * as PostList from "./post-list/index.ts";
|
|
13
|
+
export * as PostMeta from "./post-meta/index.ts";
|
|
14
14
|
export * as Scheme from "./scheme/index.ts";
|
|
15
15
|
export * as Scrolls from "./scrolls/index.ts";
|
|
16
|
-
export * as SkipLink from "./
|
|
16
|
+
export * as SkipLink from "./skip-link/index.ts";
|
|
17
17
|
export * as Swatch from "./swatch/index.ts";
|
|
18
18
|
export * as Table from "./table/index.ts";
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
// simple rat's Foldkit components. Each renders the markup simple-rat.css styles; plain
|
|
2
|
-
// elements (paragraphs, lists, quotes, kbd, mark, details) need no component.
|
|
3
1
|
export * as Code from "./code/index.js";
|
|
4
|
-
export * as CodeBlock from "./
|
|
5
|
-
export * as CopyTab from "./
|
|
2
|
+
export * as CodeBlock from "./code-block/index.js";
|
|
3
|
+
export * as CopyTab from "./copy-tab/index.js";
|
|
6
4
|
export * as Diagram from "./diagram/index.js";
|
|
7
5
|
export * as Footer from "./footer/index.js";
|
|
8
6
|
export * as Footnotes from "./footnotes/index.js";
|
|
9
7
|
export * as Header from "./header/index.js";
|
|
10
8
|
export * as Heading from "./heading/index.js";
|
|
11
|
-
export * as NavLink from "./
|
|
9
|
+
export * as NavLink from "./nav-link/index.js";
|
|
12
10
|
export * as Note from "./note/index.js";
|
|
13
11
|
export * as Pager from "./pager/index.js";
|
|
14
|
-
export * as PostList from "./
|
|
15
|
-
export * as PostMeta from "./
|
|
12
|
+
export * as PostList from "./post-list/index.js";
|
|
13
|
+
export * as PostMeta from "./post-meta/index.js";
|
|
16
14
|
export * as Scheme from "./scheme/index.js";
|
|
17
15
|
export * as Scrolls from "./scrolls/index.js";
|
|
18
|
-
export * as SkipLink from "./
|
|
16
|
+
export * as SkipLink from "./skip-link/index.js";
|
|
19
17
|
export * as Swatch from "./swatch/index.js";
|
|
20
18
|
export * as Table from "./table/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/nav-link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { view } from "./nav-link.js";
|
|
@@ -10,4 +10,4 @@ export type ViewConfig = Readonly<{
|
|
|
10
10
|
}>;
|
|
11
11
|
/** A link in the header nav. Nav links never turn visited purple. */
|
|
12
12
|
export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=nav-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-link.d.ts","sourceRoot":"","sources":["../../../src/nav-link/nav-link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd;wCACoC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CAC1C,CAAC,CAAC;AAEH,qEAAqE;AACrE,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAWF,CAAC"}
|
|
@@ -3,5 +3,5 @@ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
|
3
3
|
export const view = (config, h) => {
|
|
4
4
|
const pageAttributes = config.current === "Page" ? [h.AriaCurrent("page")] : [];
|
|
5
5
|
const sectionAttributes = config.current === "Section" ? [h.AriaCurrent("true")] : [];
|
|
6
|
-
return __foldkitBrandViewResult((h.a([h.Href(config.href), ...pageAttributes, ...sectionAttributes], [config.label])), "@gjermundgaraba-designs/simple-rat/src/
|
|
6
|
+
return __foldkitBrandViewResult((h.a([h.Href(config.href), ...pageAttributes, ...sectionAttributes], [config.label])), "@gjermundgaraba-designs/simple-rat/src/nav-link/nav-link.js#view");
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/note/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/note/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/note/note.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC;4DACwD;IACxD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,aAAa,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACpC,CAAC,CAAC;AAEH;uCACuC;AACvC,eAAO,MAAM,IAAI,GAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/note/note.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC;4DACwD;IACxD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,aAAa,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACpC,CAAC,CAAC;AAEH;uCACuC;AACvC,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAOF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pager.d.ts","sourceRoot":"","sources":["../../../src/pager/pager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE7D,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,iCAAiC;IACjC,GAAG,EAAE,IAAI,CAAC;CACX,CAAC,CAAC;AAEH;gDACgD;AAChD,eAAO,MAAM,IAAI,GAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"pager.d.ts","sourceRoot":"","sources":["../../../src/pager/pager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE7D,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,iCAAiC;IACjC,GAAG,EAAE,IAAI,CAAC;CACX,CAAC,CAAC;AAEH;gDACgD;AAChD,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAeF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/post-list/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { view } from "./post-list.js";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Html, HtmlBuilder } from "foldkit/html";
|
|
2
2
|
export type Entry = Readonly<{
|
|
3
|
+
/** ISO date. */
|
|
3
4
|
date: string;
|
|
4
5
|
title: string;
|
|
5
6
|
href: string;
|
|
6
7
|
}>;
|
|
7
8
|
/** Configuration for rendering a post list with `view`. */
|
|
8
9
|
export type ViewConfig = Readonly<{
|
|
9
|
-
posts:
|
|
10
|
+
posts: readonly Entry[];
|
|
10
11
|
}>;
|
|
11
12
|
/** A list of posts: date, then title, in two columns. */
|
|
12
13
|
export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
|
|
13
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=post-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-list.d.ts","sourceRoot":"","sources":["../../../src/post-list/post-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,2DAA2D;AAC3D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,SAAS,KAAK,EAAE,CAAA;CAAE,CAAC,CAAC;AAE/D,yDAAyD;AACzD,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAaA,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
/** A list of posts: date, then title, in two columns. */
|
|
3
|
+
export const view = (config, h) => __foldkitBrandViewResult((h.ul([h.Class("posts")], config.posts.map((post) => __foldkitBrandViewResult((h.keyed("li")(post.href, [], [
|
|
4
|
+
h.time([h.Datetime(post.date)], [post.date]),
|
|
5
|
+
h.a([h.Href(post.href)], [post.title]),
|
|
6
|
+
])), "@gjermundgaraba-designs/simple-rat/src/post-list/post-list.js#anonymous")))), "@gjermundgaraba-designs/simple-rat/src/post-list/post-list.js#view");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/post-meta/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { view } from "./post-meta.js";
|
|
@@ -8,4 +8,4 @@ export type ViewConfig = Readonly<{
|
|
|
8
8
|
}>;
|
|
9
9
|
/** Everything about a post, on one muted line under its title: the date, then the rest. */
|
|
10
10
|
export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=post-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-meta.d.ts","sourceRoot":"","sources":["../../../src/post-meta/post-meta.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,IAAI,CAAC,EAAE,aAAa,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;CACrC,CAAC,CAAC;AAEH,2FAA2F;AAC3F,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAUA,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { Array } from "effect";
|
|
|
4
4
|
export const view = (config, h) => __foldkitBrandViewResult((h.p([h.Class("meta")], [
|
|
5
5
|
h.time([h.Datetime(config.date)], [config.date]),
|
|
6
6
|
...Array.match(config.body ?? [], {
|
|
7
|
-
onEmpty: () => __foldkitBrandViewResult(([]), "@gjermundgaraba-designs/simple-rat/src/
|
|
8
|
-
onNonEmpty: (body) => __foldkitBrandViewResult(([" · ", ...body]), "@gjermundgaraba-designs/simple-rat/src/
|
|
7
|
+
onEmpty: () => __foldkitBrandViewResult(([]), "@gjermundgaraba-designs/simple-rat/src/post-meta/post-meta.js#onEmpty"),
|
|
8
|
+
onNonEmpty: (body) => __foldkitBrandViewResult(([" · ", ...body]), "@gjermundgaraba-designs/simple-rat/src/post-meta/post-meta.js#onNonEmpty"),
|
|
9
9
|
}),
|
|
10
|
-
])), "@gjermundgaraba-designs/simple-rat/src/
|
|
10
|
+
])), "@gjermundgaraba-designs/simple-rat/src/post-meta/post-meta.js#view");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scheme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scheme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC"}
|
package/dist/src/scheme/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { Message, Model, PinScheme, ReadScheme, id, init, update, } from "./switch.ts";
|
|
2
|
+
export type { InitConfig } from "./switch.ts";
|
|
2
3
|
/** `theme: system/light/dark`, last in the header nav: three buttons, each built on
|
|
3
4
|
`@foldkit/ui`'s Button, the current choice pressed (and styled as plain text), each
|
|
4
5
|
pressed state announced. Put `schemeScript` in the page's `<head>` so a remembered choice
|
|
@@ -15,4 +16,4 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
15
16
|
readonly _tag: "SelectedScheme";
|
|
16
17
|
readonly scheme: "Dark" | "Light" | "System";
|
|
17
18
|
}, void>;
|
|
18
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=scheme-switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheme-switch.d.ts","sourceRoot":"","sources":["../../../src/scheme/scheme-switch.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,EAAE,EACF,IAAI,EACJ,MAAM,GACP,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQ9C;;;kCAGkC;AAClC,eAAO,MAAM,IAAI;;;;;;;;;;;QAwBhB,CAAC"}
|
|
@@ -2,8 +2,7 @@ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
|
2
2
|
import { Button as UiButton } from "@foldkit/ui";
|
|
3
3
|
import { defineView } from "foldkit/submodel";
|
|
4
4
|
import { Message } from "./switch.js";
|
|
5
|
-
export
|
|
6
|
-
// VIEW
|
|
5
|
+
export { Message, Model, PinScheme, ReadScheme, id, init, update, } from "./switch.js";
|
|
7
6
|
const CHOICES = [
|
|
8
7
|
{ scheme: "System", label: "system" },
|
|
9
8
|
{ scheme: "Light", label: "light" },
|
|
@@ -19,7 +18,10 @@ export const view = defineView((model, h) => __foldkitBrandViewResult((h.span([h
|
|
|
19
18
|
...(index > 0 ? ["/"] : []),
|
|
20
19
|
UiButton.view({
|
|
21
20
|
onClick: Message.SelectedScheme({ scheme: choice }),
|
|
22
|
-
toView: ({ button }) => __foldkitBrandViewResult((h.button([
|
|
21
|
+
toView: ({ button }) => __foldkitBrandViewResult((h.button([
|
|
22
|
+
...button,
|
|
23
|
+
h.AriaPressed(choice === model.scheme ? "true" : "false"),
|
|
24
|
+
], [label])), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme-switch.js#toView"),
|
|
23
25
|
}, h),
|
|
24
|
-
]), "@gjermundgaraba-designs/simple-rat/src/scheme/
|
|
25
|
-
])), "@gjermundgaraba-designs/simple-rat/src/scheme/
|
|
26
|
+
]), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme-switch.js#anonymous~2")),
|
|
27
|
+
])), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme-switch.js#anonymous"));
|
|
@@ -3,8 +3,6 @@ import { Option, Schema } from "effect";
|
|
|
3
3
|
follows the reader's system in CSS alone. */
|
|
4
4
|
export declare const Scheme: Schema.Literals<readonly ["System", "Light", "Dark"]>;
|
|
5
5
|
export type Scheme = typeof Scheme.Type;
|
|
6
|
-
/** The `data-scheme` value a scheme pins, or none for `System`. */
|
|
7
6
|
export declare const toPinnedValue: (scheme: Scheme) => Option.Option<string>;
|
|
8
|
-
/** The scheme a `data-scheme` value pins. Anything else, or nothing, is `System`. */
|
|
9
7
|
export declare const fromPinnedValue: (value: string | null | undefined) => Scheme;
|
|
10
8
|
//# sourceMappingURL=scheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../../src/scheme/scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C;gDACgD;AAChD,eAAO,MAAM,MAAM,uDAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"scheme.d.ts","sourceRoot":"","sources":["../../../src/scheme/scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C;gDACgD;AAChD,eAAO,MAAM,MAAM,uDAA+C,CAAC;AAEnE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAC;AAExC,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAOhE,CAAC;AAEJ,eAAO,MAAM,eAAe,UAAW,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MAMhE,CAAC"}
|
|
@@ -3,7 +3,5 @@ import { Match, Option, Schema } from "effect";
|
|
|
3
3
|
/** The colour scheme: `Light` or `Dark` pinned on `<html data-scheme>`, or `System`, which
|
|
4
4
|
follows the reader's system in CSS alone. */
|
|
5
5
|
export const Scheme = Schema.Literals(["System", "Light", "Dark"]);
|
|
6
|
-
/** The `data-scheme` value a scheme pins, or none for `System`. */
|
|
7
6
|
export const toPinnedValue = (scheme) => __foldkitBrandViewResult((Match.value(scheme).pipe(Match.withReturnType(), Match.when("System", () => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#anonymous")), Match.when("Light", () => __foldkitBrandViewResult((Option.some("light")), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#anonymous~2")), Match.when("Dark", () => __foldkitBrandViewResult((Option.some("dark")), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#anonymous~3")), Match.exhaustive)), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#toPinnedValue");
|
|
8
|
-
/** The scheme a `data-scheme` value pins. Anything else, or nothing, is `System`. */
|
|
9
7
|
export const fromPinnedValue = (value) => __foldkitBrandViewResult((Match.value(value).pipe(Match.withReturnType(), Match.when("light", () => __foldkitBrandViewResult(("Light"), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#anonymous~4")), Match.when("dark", () => __foldkitBrandViewResult(("Dark"), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#anonymous~5")), Match.orElse(() => __foldkitBrandViewResult(("System"), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#anonymous~6")))), "@gjermundgaraba-designs/simple-rat/src/scheme/scheme.js#fromPinnedValue");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/scheme/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAG3C,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/scheme/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAG3C,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAK9C;YACY;AACZ,eAAO,MAAM,KAAK;;;EAGhB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAEtC,2DAA2D;AAC3D,eAAO,MAAM,OAAO;;QACA,MAAM;;;;QAED,MAAM;;EAC7B,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C;;;kBAGkB;AAClB,eAAO,MAAM,SAAS;;;;iBAgBpB,CAAC;AAEH;4CAC4C;AAC5C,eAAO,MAAM,UAAU;;;iBASrB,CAAC;AAEH,uFAAuF;AACvF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElD;;4FAE4F;AAC5F,eAAO,MAAM,IAAI,WAAY,UAAU,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAGpE,CAAC;AAEH,uBAAuB;AACvB,eAAO,MAAM,EAAE,UAAW,KAAK,KAAG,MAAkB,CAAC;AAErD,iFAAiF;AACjF,eAAO,MAAM,MAAM,UAAW,KAAK,WAAW,OAAO;;;;;;;;;;;;;;;EAUjD,CAAC"}
|
|
@@ -5,23 +5,18 @@ import { defineMessageUnion } from "foldkit/message";
|
|
|
5
5
|
import { modifyFields } from "foldkit/struct";
|
|
6
6
|
import { Scheme, fromPinnedValue, toPinnedValue } from "./scheme.js";
|
|
7
7
|
import { SCHEME_ATTRIBUTE, SCHEME_STORAGE_KEY } from "./script.js";
|
|
8
|
-
// The scheme switch without its view, the same file in every system that has it; the view
|
|
9
|
-
// is the system's own, in schemeSwitch.ts, which also passes all of this on.
|
|
10
|
-
// MODEL
|
|
11
8
|
/** Schema for the scheme switch: its id, and the scheme in force as far as the page has
|
|
12
9
|
seen. */
|
|
13
10
|
export const Model = Schema.Struct({
|
|
14
11
|
id: Schema.String,
|
|
15
12
|
scheme: Scheme,
|
|
16
13
|
});
|
|
17
|
-
// MESSAGE
|
|
18
14
|
/** Union of all Messages the scheme switch can produce. */
|
|
19
15
|
export const Message = defineMessageUnion({
|
|
20
16
|
SelectedScheme: { scheme: Scheme },
|
|
21
17
|
CompletedPinScheme: {},
|
|
22
18
|
CompletedReadScheme: { scheme: Scheme },
|
|
23
19
|
});
|
|
24
|
-
// COMMAND
|
|
25
20
|
/** Pins a scheme on `<html data-scheme>` and remembers it on this device in `localStorage`
|
|
26
21
|
under the key `schemeScript` reads; `System` removes both. The attribute is written first,
|
|
27
22
|
so storage that refuses (blocked or full) still switches the page; the choice is just not
|
|
@@ -29,16 +24,18 @@ export const Message = defineMessageUnion({
|
|
|
29
24
|
export const PinScheme = Command.define("PinScheme", {
|
|
30
25
|
args: { scheme: Scheme },
|
|
31
26
|
messages: [Message.CompletedPinScheme],
|
|
32
|
-
execute: ({ scheme }) => __foldkitBrandViewResult((Effect.try(() =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
execute: ({ scheme }) => __foldkitBrandViewResult((Effect.try(() => {
|
|
28
|
+
Option.match(toPinnedValue(scheme), {
|
|
29
|
+
onNone: () => {
|
|
30
|
+
document.documentElement.removeAttribute(SCHEME_ATTRIBUTE);
|
|
31
|
+
localStorage.removeItem(SCHEME_STORAGE_KEY);
|
|
32
|
+
},
|
|
33
|
+
onSome: (value) => {
|
|
34
|
+
document.documentElement.setAttribute(SCHEME_ATTRIBUTE, value);
|
|
35
|
+
localStorage.setItem(SCHEME_STORAGE_KEY, value);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}).pipe(Effect.ignore, Effect.as(Message.CompletedPinScheme()))), "@gjermundgaraba-designs/simple-rat/src/scheme/switch.js#execute"),
|
|
42
39
|
});
|
|
43
40
|
/** Reads the scheme in force from `<html data-scheme>`: what `schemeScript` pinned before
|
|
44
41
|
the page ran, or `System` without it. */
|
|
@@ -55,10 +52,8 @@ export const init = (config) => (__foldkitBrandViewResult(({
|
|
|
55
52
|
model: { id: config.id, scheme: "System" },
|
|
56
53
|
commands: [ReadScheme()],
|
|
57
54
|
}), "@gjermundgaraba-designs/simple-rat/src/scheme/switch.js#init"));
|
|
58
|
-
// ACCESSORS
|
|
59
55
|
/** The switch's id. */
|
|
60
56
|
export const id = (model) => __foldkitBrandViewResult((model.id), "@gjermundgaraba-designs/simple-rat/src/scheme/switch.js#id");
|
|
61
|
-
// UPDATE
|
|
62
57
|
/** Processes a scheme switch Message and returns the next Model and Commands. */
|
|
63
58
|
export const update = (model, message) => __foldkitBrandViewResult((Message.match(message, {
|
|
64
59
|
SelectedScheme: ({ scheme }) => (__foldkitBrandViewResult(({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrolls.d.ts","sourceRoot":"","sources":["../../../src/scrolls/scrolls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"scrolls.d.ts","sourceRoot":"","sources":["../../../src/scrolls/scrolls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAEvC,6EAA6E;AAC7E,eAAO,MAAM,OAAO;;EAAqD,CAAC;AAE1E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C;;;;;iGAKiG;AACjG,eAAO,MAAM,aAAa;;;;EA8CxB,CAAC"}
|
|
@@ -2,10 +2,8 @@ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
|
2
2
|
import { Effect, Option, Schema } from "effect";
|
|
3
3
|
import { defineMessageUnion } from "foldkit/message";
|
|
4
4
|
import * as Mount from "foldkit/mount";
|
|
5
|
-
// MESSAGE
|
|
6
5
|
/** What the Mount reports: it is watching. Nothing in a Model follows it. */
|
|
7
6
|
export const Message = defineMessageUnion({ CompletedWatchOverflow: {} });
|
|
8
|
-
// MOUNT
|
|
9
7
|
/** Whether a block is wider than its box and scrolls sideways, checked when it mounts and
|
|
10
8
|
whenever its own box changes size, as when the window resizes. A font arriving that
|
|
11
9
|
widens the text but not the box is not noticed. A block that scrolls takes keyboard focus
|
|
@@ -17,6 +15,13 @@ export const WatchOverflow = Mount.define("WatchOverflow", {
|
|
|
17
15
|
messages: [Message.CompletedWatchOverflow],
|
|
18
16
|
execute: ({ element, maybeName }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
19
17
|
yield* Effect.acquireRelease(Effect.sync(() => {
|
|
18
|
+
const clear = () => {
|
|
19
|
+
element.removeAttribute("tabindex");
|
|
20
|
+
if (Option.isSome(maybeName)) {
|
|
21
|
+
element.removeAttribute("role");
|
|
22
|
+
element.removeAttribute("aria-label");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
20
25
|
const check = () => {
|
|
21
26
|
if (element.scrollWidth > element.clientWidth) {
|
|
22
27
|
element.setAttribute("tabindex", "0");
|
|
@@ -29,13 +34,6 @@ export const WatchOverflow = Mount.define("WatchOverflow", {
|
|
|
29
34
|
clear();
|
|
30
35
|
}
|
|
31
36
|
};
|
|
32
|
-
const clear = () => {
|
|
33
|
-
element.removeAttribute("tabindex");
|
|
34
|
-
if (Option.isSome(maybeName)) {
|
|
35
|
-
element.removeAttribute("role");
|
|
36
|
-
element.removeAttribute("aria-label");
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
37
|
const resized = new ResizeObserver(check);
|
|
40
38
|
resized.observe(element);
|
|
41
39
|
check();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skip-link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { view } from "./skip-link.js";
|
|
@@ -4,4 +4,4 @@ import type { Html, HtmlBuilder } from "foldkit/html";
|
|
|
4
4
|
update, so it must hand a fragment on the page being read back to the browser:
|
|
5
5
|
`load(href)` from `foldkit/navigation`. */
|
|
6
6
|
export declare const view: <Message>(h: HtmlBuilder<Message>) => Html;
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=skip-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../src/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD;;;8CAG8C;AAC9C,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IACM,CAAC"}
|
|
@@ -3,4 +3,4 @@ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
|
3
3
|
on `<main id="main">`. A Foldkit application routes every link click through its own
|
|
4
4
|
update, so it must hand a fragment on the page being read back to the browser:
|
|
5
5
|
`load(href)` from `foldkit/navigation`. */
|
|
6
|
-
export const view = (h) => __foldkitBrandViewResult((h.a([h.Class("skip"), h.Href("#main")], ["Skip to content"])), "@gjermundgaraba-designs/simple-rat/src/
|
|
6
|
+
export const view = (h) => __foldkitBrandViewResult((h.a([h.Class("skip"), h.Href("#main")], ["Skip to content"])), "@gjermundgaraba-designs/simple-rat/src/skip-link/skip-link.js#view");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Html, HtmlBuilder } from "foldkit/html";
|
|
2
2
|
/** Configuration for rendering a table with `view`. */
|
|
3
3
|
export type ViewConfig = Readonly<{
|
|
4
|
-
columns:
|
|
4
|
+
columns: readonly string[];
|
|
5
5
|
rows: ReadonlyArray<ReadonlyArray<Html | string>>;
|
|
6
6
|
/** Under 40rem each row becomes a card, its cells labelled with their column. Without it
|
|
7
7
|
the table stays a table on a phone and scrolls sideways. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/table/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/table/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;IAClD;mEAC+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;oDAGoD;AACpD,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,KACf,WAAW,CAAC,OAAO,CAAC,KACtB,IAwCF,CAAC"}
|
package/dist/src/table/table.js
CHANGED
|
@@ -15,7 +15,9 @@ export const view = (config, h) => {
|
|
|
15
15
|
const label = columns[index];
|
|
16
16
|
return __foldkitBrandViewResult((h.td([
|
|
17
17
|
...role("cell"),
|
|
18
|
-
...(isStacked && label !== undefined
|
|
18
|
+
...(isStacked && label !== undefined
|
|
19
|
+
? [h.DataAttribute("label", label)]
|
|
20
|
+
: []),
|
|
19
21
|
], [cell])), "@gjermundgaraba-designs/simple-rat/src/table/table.js#anonymous~3");
|
|
20
22
|
}))), "@gjermundgaraba-designs/simple-rat/src/table/table.js#anonymous~2"))),
|
|
21
23
|
]),
|