@turnipxenon/pineapple 2.4.30 → 2.4.32
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/.idea/workspace.xml +27 -25
- package/.svelte-kit/__package__/components/navigation_component/NavigationComponent.svelte +8 -8
- package/.svelte-kit/__package__/components/navigation_component/NavigationComponent.svelte.d.ts +1 -1
- package/.svelte-kit/__package__/components/navigation_component/PageMeta.d.ts +1 -0
- package/.svelte-kit/__package__/components/navigation_component/PageMeta.js +19 -12
- package/.svelte-kit/__package__/components/navigation_component/index.d.ts +2 -0
- package/.svelte-kit/__package__/components/navigation_component/index.js +3 -0
- package/.svelte-kit/__package__/index.d.ts +1 -0
- package/.svelte-kit/__package__/index.js +1 -0
- package/.svelte-kit/generated/server/internal.js +1 -1
- package/dist/components/navigation_component/NavigationComponent.svelte +8 -8
- package/dist/components/navigation_component/NavigationComponent.svelte.d.ts +1 -1
- package/dist/components/navigation_component/PageMeta.d.ts +1 -0
- package/dist/components/navigation_component/PageMeta.js +19 -12
- package/dist/components/navigation_component/index.d.ts +2 -0
- package/dist/components/navigation_component/index.js +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/src/lib/components/navigation_component/NavigationComponent.svelte +10 -8
- package/src/lib/components/navigation_component/PageMeta.ts +20 -13
- package/src/lib/components/navigation_component/index.ts +4 -0
- package/src/lib/index.ts +1 -0
package/.idea/workspace.xml
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="accb6ba2-c343-4f84-ad30-6e2d71eceee5" name="Changes" comment="
|
|
7
|
+
<list default="true" id="accb6ba2-c343-4f84-ad30-6e2d71eceee5" name="Changes" comment="Export NavigationComponent">
|
|
8
8
|
<change beforePath="$PROJECT_DIR$/src/lib/components/navigation_component/NavigationComponent.svelte" beforeDir="false" afterPath="$PROJECT_DIR$/src/lib/components/navigation_component/NavigationComponent.svelte" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/src/lib/components/navigation_component/
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/src/lib/components/navigation_component/PageMeta.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/lib/components/navigation_component/PageMeta.ts" afterDir="false" />
|
|
10
10
|
</list>
|
|
11
11
|
<option name="SHOW_DIALOG" value="false" />
|
|
12
12
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"WebServerToolWindowFactoryState": "false",
|
|
94
94
|
"git-widget-placeholder": "turnip/navigation",
|
|
95
95
|
"ignore.virus.scanning.warn.message": "true",
|
|
96
|
-
"last_opened_file_path": "C:/Users/Pumpkin/Projects/Web/pineapple/src/
|
|
96
|
+
"last_opened_file_path": "C:/Users/Pumpkin/Projects/Web/pineapple/src/lib/components/navigation_component",
|
|
97
97
|
"list.type.of.created.stylesheet": "CSS",
|
|
98
98
|
"node.js.detected.package.eslint": "true",
|
|
99
99
|
"node.js.detected.package.tslint": "true",
|
|
@@ -114,11 +114,11 @@
|
|
|
114
114
|
}</component>
|
|
115
115
|
<component name="RecentsManager">
|
|
116
116
|
<key name="CopyFile.RECENT_KEYS">
|
|
117
|
+
<recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\lib\components\navigation_component" />
|
|
117
118
|
<recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\page3\page7\(test_layout)\page8" />
|
|
118
119
|
<recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\page3\page7" />
|
|
119
120
|
<recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\page3" />
|
|
120
121
|
<recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\page3\page5" />
|
|
121
|
-
<recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple" />
|
|
122
122
|
</key>
|
|
123
123
|
<key name="MoveFile.RECENT_KEYS">
|
|
124
124
|
<recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\(extra-pages)" />
|
|
@@ -240,23 +240,9 @@
|
|
|
240
240
|
<workItem from="1711463423241" duration="256000" />
|
|
241
241
|
<workItem from="1711471654056" duration="635000" />
|
|
242
242
|
<workItem from="1711472302524" duration="9738000" />
|
|
243
|
-
<workItem from="1711482094100" duration="
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
<option name="closed" value="true" />
|
|
247
|
-
<created>1710298224571</created>
|
|
248
|
-
<option name="number" value="00058" />
|
|
249
|
-
<option name="presentableId" value="LOCAL-00058" />
|
|
250
|
-
<option name="project" value="LOCAL" />
|
|
251
|
-
<updated>1710298224571</updated>
|
|
252
|
-
</task>
|
|
253
|
-
<task id="LOCAL-00059" summary="Add data-nosnippet">
|
|
254
|
-
<option name="closed" value="true" />
|
|
255
|
-
<created>1710305409664</created>
|
|
256
|
-
<option name="number" value="00059" />
|
|
257
|
-
<option name="presentableId" value="LOCAL-00059" />
|
|
258
|
-
<option name="project" value="LOCAL" />
|
|
259
|
-
<updated>1710305409664</updated>
|
|
243
|
+
<workItem from="1711482094100" duration="5506000" />
|
|
244
|
+
<workItem from="1711487798169" duration="264000" />
|
|
245
|
+
<workItem from="1711488375110" duration="657000" />
|
|
260
246
|
</task>
|
|
261
247
|
<task id="LOCAL-00060" summary="Fix wrong link in migrante">
|
|
262
248
|
<option name="closed" value="true" />
|
|
@@ -634,7 +620,23 @@
|
|
|
634
620
|
<option name="project" value="LOCAL" />
|
|
635
621
|
<updated>1711485359574</updated>
|
|
636
622
|
</task>
|
|
637
|
-
<
|
|
623
|
+
<task id="LOCAL-00107" summary="Set queryParams based on index and pageSize">
|
|
624
|
+
<option name="closed" value="true" />
|
|
625
|
+
<created>1711487464414</created>
|
|
626
|
+
<option name="number" value="00107" />
|
|
627
|
+
<option name="presentableId" value="LOCAL-00107" />
|
|
628
|
+
<option name="project" value="LOCAL" />
|
|
629
|
+
<updated>1711487464414</updated>
|
|
630
|
+
</task>
|
|
631
|
+
<task id="LOCAL-00108" summary="Export NavigationComponent">
|
|
632
|
+
<option name="closed" value="true" />
|
|
633
|
+
<created>1711487908874</created>
|
|
634
|
+
<option name="number" value="00108" />
|
|
635
|
+
<option name="presentableId" value="LOCAL-00108" />
|
|
636
|
+
<option name="project" value="LOCAL" />
|
|
637
|
+
<updated>1711487908874</updated>
|
|
638
|
+
</task>
|
|
639
|
+
<option name="localTasksCounter" value="109" />
|
|
638
640
|
<servers />
|
|
639
641
|
</component>
|
|
640
642
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -692,8 +694,6 @@
|
|
|
692
694
|
</option>
|
|
693
695
|
</component>
|
|
694
696
|
<component name="VcsManagerConfiguration">
|
|
695
|
-
<MESSAGE value="Fix breadcrumb layout" />
|
|
696
|
-
<MESSAGE value="Fix default card postcss style" />
|
|
697
697
|
<MESSAGE value="Adjust turnip fab button color" />
|
|
698
698
|
<MESSAGE value="Replace btn-group postcss class with turnip-menu There is postcss defined class called btn-group which has styles that have !important, which I accidentally used not knowing it exists, and it overrides whatever styles I apply on my class" />
|
|
699
699
|
<MESSAGE value="Add external link warning stub" />
|
|
@@ -717,6 +717,8 @@
|
|
|
717
717
|
<MESSAGE value="Move test pages into a directory" />
|
|
718
718
|
<MESSAGE value="Add Navigation control" />
|
|
719
719
|
<MESSAGE value="Move NavigationControl to a component" />
|
|
720
|
-
<
|
|
720
|
+
<MESSAGE value="Set queryParams based on index and pageSize" />
|
|
721
|
+
<MESSAGE value="Export NavigationComponent" />
|
|
722
|
+
<option name="LAST_COMMIT_MESSAGE" value="Export NavigationComponent" />
|
|
721
723
|
</component>
|
|
722
724
|
</project>
|
|
@@ -4,7 +4,7 @@ import { parsePageMeta } from "./PageMeta";
|
|
|
4
4
|
export let title = void 0;
|
|
5
5
|
export let fileList;
|
|
6
6
|
export let parentSubpath;
|
|
7
|
-
export let compareFn;
|
|
7
|
+
export let compareFn = void 0;
|
|
8
8
|
export let pageSize = 5;
|
|
9
9
|
export let currentIndex = 0;
|
|
10
10
|
const pageFlatList = parsePageMeta(fileList, compareFn);
|
|
@@ -13,19 +13,19 @@ $:
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<div class="navigation-wrapper">
|
|
16
|
+
{#if (title)}
|
|
17
|
+
<Card>
|
|
18
|
+
<h1 slot="content" class="default-card navigation-title">
|
|
19
|
+
{title}
|
|
20
|
+
</h1>
|
|
21
|
+
</Card>
|
|
22
|
+
{/if}
|
|
16
23
|
|
|
17
24
|
<NavigationControl bind:currentIndex={currentIndex}
|
|
18
25
|
bind:contentLength={pageFlatList.length}
|
|
19
26
|
bind:pageSize={pageSize}></NavigationControl>
|
|
20
27
|
|
|
21
28
|
<div class="navigation-component">
|
|
22
|
-
{#if (title)}
|
|
23
|
-
<Card>
|
|
24
|
-
<h1 slot="content" class="default-card navigation-title">
|
|
25
|
-
{title}
|
|
26
|
-
</h1>
|
|
27
|
-
</Card>
|
|
28
|
-
{/if}
|
|
29
29
|
<!-- all the misc routes-->
|
|
30
30
|
{#each visiblePages as pageMeta}
|
|
31
31
|
{@const fullPath=`${parentSubpath}${pageMeta.relativeLink}`}
|
package/.svelte-kit/__package__/components/navigation_component/NavigationComponent.svelte.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
/**
|
|
8
8
|
* Should include a slash before and after the path
|
|
9
9
|
*/ parentSubpath: string;
|
|
10
|
-
compareFn
|
|
10
|
+
compareFn?: undefined | ParsePageMetaCompareFn;
|
|
11
11
|
pageSize?: number | undefined;
|
|
12
12
|
currentIndex?: number | undefined;
|
|
13
13
|
};
|
|
@@ -44,25 +44,32 @@ export const parsePageMeta = (fileList, compareFn) => {
|
|
|
44
44
|
// let metadata : undefined | Map<string, string | string[]>;
|
|
45
45
|
if (body.startsWith("<!--")) {
|
|
46
46
|
// todo: absorb more metadata
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
meta.
|
|
57
|
-
if (
|
|
58
|
-
|
|
47
|
+
try {
|
|
48
|
+
const metadata = JSON.parse(body.slice("<!--".length, body.indexOf("-->")));
|
|
49
|
+
meta.title = metadata["title"] ?? meta.title;
|
|
50
|
+
meta.tags = metadata["tags"];
|
|
51
|
+
meta.description = metadata["description"];
|
|
52
|
+
meta.datePublished = metadata["datePublished"];
|
|
53
|
+
meta.lastUpdated = metadata["lastUpdated"];
|
|
54
|
+
meta.shouldGroup = metadata["shouldGroup"];
|
|
55
|
+
meta.shouldHide = metadata["shouldHide"];
|
|
56
|
+
meta.image = metadata["image"];
|
|
57
|
+
if (meta.image) {
|
|
58
|
+
meta.imageAlt = metadata["imageAlt"];
|
|
59
|
+
if (!meta.imageAlt) {
|
|
60
|
+
console.warn(`Accessibility issues: image alt missing for image ${meta.image}`);
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.error(`Error at ${meta.relativeLink}: ${e}`);
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
pageFlatList.push(meta);
|
|
63
69
|
}
|
|
64
70
|
pageFlatList.sort((a, b) => a.relativeLink.localeCompare(b.relativeLink));
|
|
65
71
|
// find groupings
|
|
72
|
+
// grouping should be BEFORE the external sort
|
|
66
73
|
// todo: we don't even have use for this yet!
|
|
67
74
|
// pageFlatList.forEach(p => {
|
|
68
75
|
// if (!findPageMetaParent(pageGroupedList, p)) {
|
|
@@ -3,6 +3,7 @@ export { default as SeaweedTemplate } from "./template/Seaweed/SeaweedTemplate.s
|
|
|
3
3
|
export { default as LazyAsset } from "./components/LazyAsset.svelte";
|
|
4
4
|
export { default as Card } from "./components/Card.svelte";
|
|
5
5
|
export * from "./components/overrideable_meta/index";
|
|
6
|
+
export * from "./components/navigation_component/index";
|
|
6
7
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
7
8
|
export * from "./components/dialog_manager/DialogManager";
|
|
8
9
|
export * from "./components/dialog_manager/DialogUtils";
|
|
@@ -4,6 +4,7 @@ export { default as SeaweedTemplate } from "./template/Seaweed/SeaweedTemplate.s
|
|
|
4
4
|
export { default as LazyAsset } from "./components/LazyAsset.svelte";
|
|
5
5
|
export { default as Card } from "./components/Card.svelte";
|
|
6
6
|
export * from "./components/overrideable_meta/index";
|
|
7
|
+
export * from "./components/navigation_component/index";
|
|
7
8
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
8
9
|
export * from "./components/dialog_manager/DialogManager";
|
|
9
10
|
export * from "./components/dialog_manager/DialogUtils";
|
|
@@ -21,7 +21,7 @@ export const options = {
|
|
|
21
21
|
app: ({ head, body, assets, nonce, env }) => "<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<link rel=\"icon\" href=\"" + assets + "/favicon.png\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width\" />\n\t\t" + head + "\n\t</head>\n\n\t<body data-sveltekit-preload-data=\"hover\" data-theme=\"crimson\">\n\t\t<div style=\"display: contents\" class=\"h-full overflow-hidden\">" + body + "</div>\n\t</body>\n</html>\n",
|
|
22
22
|
error: ({ status, message }) => "<!doctype html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<title>" + message + "</title>\n\n\t\t<style>\n\t\t\tbody {\n\t\t\t\t--bg: white;\n\t\t\t\t--fg: #222;\n\t\t\t\t--divider: #ccc;\n\t\t\t\tbackground: var(--bg);\n\t\t\t\tcolor: var(--fg);\n\t\t\t\tfont-family:\n\t\t\t\t\tsystem-ui,\n\t\t\t\t\t-apple-system,\n\t\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t\t'Segoe UI',\n\t\t\t\t\tRoboto,\n\t\t\t\t\tOxygen,\n\t\t\t\t\tUbuntu,\n\t\t\t\t\tCantarell,\n\t\t\t\t\t'Open Sans',\n\t\t\t\t\t'Helvetica Neue',\n\t\t\t\t\tsans-serif;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.error {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmax-width: 32rem;\n\t\t\t\tmargin: 0 1rem;\n\t\t\t}\n\n\t\t\t.status {\n\t\t\t\tfont-weight: 200;\n\t\t\t\tfont-size: 3rem;\n\t\t\t\tline-height: 1;\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -0.05rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tborder-left: 1px solid var(--divider);\n\t\t\t\tpadding: 0 0 0 1rem;\n\t\t\t\tmargin: 0 0 0 1rem;\n\t\t\t\tmin-height: 2.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.message h1 {\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-size: 1em;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (prefers-color-scheme: dark) {\n\t\t\t\tbody {\n\t\t\t\t\t--bg: #222;\n\t\t\t\t\t--fg: #ddd;\n\t\t\t\t\t--divider: #666;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div class=\"error\">\n\t\t\t<span class=\"status\">" + status + "</span>\n\t\t\t<div class=\"message\">\n\t\t\t\t<h1>" + message + "</h1>\n\t\t\t</div>\n\t\t</div>\n\t</body>\n</html>\n"
|
|
23
23
|
},
|
|
24
|
-
version_hash: "
|
|
24
|
+
version_hash: "19q2v79"
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export async function get_hooks() {
|
|
@@ -4,7 +4,7 @@ import { parsePageMeta } from "./PageMeta";
|
|
|
4
4
|
export let title = void 0;
|
|
5
5
|
export let fileList;
|
|
6
6
|
export let parentSubpath;
|
|
7
|
-
export let compareFn;
|
|
7
|
+
export let compareFn = void 0;
|
|
8
8
|
export let pageSize = 5;
|
|
9
9
|
export let currentIndex = 0;
|
|
10
10
|
const pageFlatList = parsePageMeta(fileList, compareFn);
|
|
@@ -13,19 +13,19 @@ $:
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<div class="navigation-wrapper">
|
|
16
|
+
{#if (title)}
|
|
17
|
+
<Card>
|
|
18
|
+
<h1 slot="content" class="default-card navigation-title">
|
|
19
|
+
{title}
|
|
20
|
+
</h1>
|
|
21
|
+
</Card>
|
|
22
|
+
{/if}
|
|
16
23
|
|
|
17
24
|
<NavigationControl bind:currentIndex={currentIndex}
|
|
18
25
|
bind:contentLength={pageFlatList.length}
|
|
19
26
|
bind:pageSize={pageSize}></NavigationControl>
|
|
20
27
|
|
|
21
28
|
<div class="navigation-component">
|
|
22
|
-
{#if (title)}
|
|
23
|
-
<Card>
|
|
24
|
-
<h1 slot="content" class="default-card navigation-title">
|
|
25
|
-
{title}
|
|
26
|
-
</h1>
|
|
27
|
-
</Card>
|
|
28
|
-
{/if}
|
|
29
29
|
<!-- all the misc routes-->
|
|
30
30
|
{#each visiblePages as pageMeta}
|
|
31
31
|
{@const fullPath=`${parentSubpath}${pageMeta.relativeLink}`}
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
/**
|
|
8
8
|
* Should include a slash before and after the path
|
|
9
9
|
*/ parentSubpath: string;
|
|
10
|
-
compareFn
|
|
10
|
+
compareFn?: undefined | ParsePageMetaCompareFn;
|
|
11
11
|
pageSize?: number | undefined;
|
|
12
12
|
currentIndex?: number | undefined;
|
|
13
13
|
};
|
|
@@ -44,25 +44,32 @@ export const parsePageMeta = (fileList, compareFn) => {
|
|
|
44
44
|
// let metadata : undefined | Map<string, string | string[]>;
|
|
45
45
|
if (body.startsWith("<!--")) {
|
|
46
46
|
// todo: absorb more metadata
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
meta.
|
|
57
|
-
if (
|
|
58
|
-
|
|
47
|
+
try {
|
|
48
|
+
const metadata = JSON.parse(body.slice("<!--".length, body.indexOf("-->")));
|
|
49
|
+
meta.title = metadata["title"] ?? meta.title;
|
|
50
|
+
meta.tags = metadata["tags"];
|
|
51
|
+
meta.description = metadata["description"];
|
|
52
|
+
meta.datePublished = metadata["datePublished"];
|
|
53
|
+
meta.lastUpdated = metadata["lastUpdated"];
|
|
54
|
+
meta.shouldGroup = metadata["shouldGroup"];
|
|
55
|
+
meta.shouldHide = metadata["shouldHide"];
|
|
56
|
+
meta.image = metadata["image"];
|
|
57
|
+
if (meta.image) {
|
|
58
|
+
meta.imageAlt = metadata["imageAlt"];
|
|
59
|
+
if (!meta.imageAlt) {
|
|
60
|
+
console.warn(`Accessibility issues: image alt missing for image ${meta.image}`);
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.error(`Error at ${meta.relativeLink}: ${e}`);
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
pageFlatList.push(meta);
|
|
63
69
|
}
|
|
64
70
|
pageFlatList.sort((a, b) => a.relativeLink.localeCompare(b.relativeLink));
|
|
65
71
|
// find groupings
|
|
72
|
+
// grouping should be BEFORE the external sort
|
|
66
73
|
// todo: we don't even have use for this yet!
|
|
67
74
|
// pageFlatList.forEach(p => {
|
|
68
75
|
// if (!findPageMetaParent(pageGroupedList, p)) {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as SeaweedTemplate } from "./template/Seaweed/SeaweedTemplate.s
|
|
|
3
3
|
export { default as LazyAsset } from "./components/LazyAsset.svelte";
|
|
4
4
|
export { default as Card } from "./components/Card.svelte";
|
|
5
5
|
export * from "./components/overrideable_meta/index";
|
|
6
|
+
export * from "./components/navigation_component/index";
|
|
6
7
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
7
8
|
export * from "./components/dialog_manager/DialogManager";
|
|
8
9
|
export * from "./components/dialog_manager/DialogUtils";
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as SeaweedTemplate } from "./template/Seaweed/SeaweedTemplate.s
|
|
|
4
4
|
export { default as LazyAsset } from "./components/LazyAsset.svelte";
|
|
5
5
|
export { default as Card } from "./components/Card.svelte";
|
|
6
6
|
export * from "./components/overrideable_meta/index";
|
|
7
|
+
export * from "./components/navigation_component/index";
|
|
7
8
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
8
9
|
export * from "./components/dialog_manager/DialogManager";
|
|
9
10
|
export * from "./components/dialog_manager/DialogUtils";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnipxenon/pineapple",
|
|
3
3
|
"description": "personal package for base styling for other personal projects",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.32",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
7
7
|
"build": "npm run check-requirements && vite build && yarn package",
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
export let title: string | undefined = undefined;
|
|
7
7
|
export let fileList: Record<string, unknown>;
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* Should include a slash before and after the path
|
|
10
11
|
*/
|
|
11
12
|
export let parentSubpath: string;
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
export let compareFn: undefined | ParsePageMetaCompareFn = undefined;
|
|
13
15
|
export let pageSize = 5;
|
|
14
16
|
export let currentIndex = 0;
|
|
15
17
|
|
|
@@ -19,19 +21,19 @@
|
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
23
|
<div class="navigation-wrapper">
|
|
24
|
+
{#if (title)}
|
|
25
|
+
<Card>
|
|
26
|
+
<h1 slot="content" class="default-card navigation-title">
|
|
27
|
+
{title}
|
|
28
|
+
</h1>
|
|
29
|
+
</Card>
|
|
30
|
+
{/if}
|
|
22
31
|
|
|
23
32
|
<NavigationControl bind:currentIndex={currentIndex}
|
|
24
33
|
bind:contentLength={pageFlatList.length}
|
|
25
34
|
bind:pageSize={pageSize}></NavigationControl>
|
|
26
35
|
|
|
27
36
|
<div class="navigation-component">
|
|
28
|
-
{#if (title)}
|
|
29
|
-
<Card>
|
|
30
|
-
<h1 slot="content" class="default-card navigation-title">
|
|
31
|
-
{title}
|
|
32
|
-
</h1>
|
|
33
|
-
</Card>
|
|
34
|
-
{/if}
|
|
35
37
|
<!-- all the misc routes-->
|
|
36
38
|
{#each visiblePages as pageMeta}
|
|
37
39
|
{@const fullPath=`${parentSubpath}${pageMeta.relativeLink}`}
|
|
@@ -18,6 +18,7 @@ export interface PageMeta {
|
|
|
18
18
|
datePublished?: string;
|
|
19
19
|
lastUpdated?: string;
|
|
20
20
|
shouldGroup?: boolean;
|
|
21
|
+
shouldHide?: boolean;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -80,20 +81,25 @@ export const parsePageMeta = (fileList: Record<string, unknown>,
|
|
|
80
81
|
// let metadata : undefined | Map<string, string | string[]>;
|
|
81
82
|
if (body.startsWith("<!--")) {
|
|
82
83
|
// todo: absorb more metadata
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
meta.
|
|
94
|
-
if (
|
|
95
|
-
|
|
84
|
+
try {
|
|
85
|
+
const metadata = JSON.parse(body.slice("<!--".length, body.indexOf("-->")));
|
|
86
|
+
meta.title = metadata["title"] ?? meta.title;
|
|
87
|
+
meta.tags = metadata["tags"];
|
|
88
|
+
meta.description = metadata["description"];
|
|
89
|
+
meta.datePublished = metadata["datePublished"];
|
|
90
|
+
meta.lastUpdated = metadata["lastUpdated"];
|
|
91
|
+
meta.shouldGroup = metadata["shouldGroup"] as boolean;
|
|
92
|
+
meta.shouldHide = metadata["shouldHide"] as boolean;
|
|
93
|
+
|
|
94
|
+
meta.image = metadata["image"];
|
|
95
|
+
if (meta.image) {
|
|
96
|
+
meta.imageAlt = metadata["imageAlt"];
|
|
97
|
+
if (!meta.imageAlt) {
|
|
98
|
+
console.warn(`Accessibility issues: image alt missing for image ${meta.image}`);
|
|
99
|
+
}
|
|
96
100
|
}
|
|
101
|
+
} catch (e) {
|
|
102
|
+
console.error(`Error at ${meta.relativeLink}: ${e}`);
|
|
97
103
|
}
|
|
98
104
|
}
|
|
99
105
|
|
|
@@ -103,6 +109,7 @@ export const parsePageMeta = (fileList: Record<string, unknown>,
|
|
|
103
109
|
pageFlatList.sort((a, b) => a.relativeLink.localeCompare(b.relativeLink));
|
|
104
110
|
|
|
105
111
|
// find groupings
|
|
112
|
+
// grouping should be BEFORE the external sort
|
|
106
113
|
// todo: we don't even have use for this yet!
|
|
107
114
|
// pageFlatList.forEach(p => {
|
|
108
115
|
// if (!findPageMetaParent(pageGroupedList, p)) {
|
package/src/lib/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as LazyAsset } from "./components/LazyAsset.svelte";
|
|
|
6
6
|
export { default as Card } from "./components/Card.svelte";
|
|
7
7
|
|
|
8
8
|
export * from "$pkg/components/overrideable_meta/index";
|
|
9
|
+
export * from "$pkg/components/navigation_component/index";
|
|
9
10
|
export * from "./components/dialog_manager/DialogManagerStore";
|
|
10
11
|
export * from "./components/dialog_manager/DialogManager";
|
|
11
12
|
export * from "./components/dialog_manager/DialogUtils";
|