@turnipxenon/pineapple 2.4.53 → 2.4.54

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.
@@ -4,7 +4,8 @@
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="Add logs to observe parseQtTerms in downstream package">
7
+ <list default="true" id="accb6ba2-c343-4f84-ad30-6e2d71eceee5" name="Changes" comment="Move parseQtTerm on afterUpdate">
8
+ <change afterPath="$PROJECT_DIR$/src/lib/template/seaweed/ParseQueryTerms.ts" afterDir="false" />
8
9
  <change beforePath="$PROJECT_DIR$/src/lib/template/seaweed/SeaweedTemplate.svelte" beforeDir="false" afterPath="$PROJECT_DIR$/src/lib/template/seaweed/SeaweedTemplate.svelte" afterDir="false" />
9
10
  </list>
10
11
  <option name="SHOW_DIALOG" value="false" />
@@ -107,41 +108,41 @@
107
108
  <option name="hideEmptyMiddlePackages" value="true" />
108
109
  <option name="showLibraryContents" value="true" />
109
110
  </component>
110
- <component name="PropertiesComponent">{
111
- &quot;keyToString&quot;: {
112
- &quot;DefaultHtmlFileTemplate&quot;: &quot;HTML File&quot;,
113
- &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
114
- &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
115
- &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
116
- &quot;git-widget-placeholder&quot;: &quot;turnip/customizable2&quot;,
117
- &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
118
- &quot;last_opened_file_path&quot;: &quot;C:/Users/Pumpkin/Projects/Web/pineapple/cdktf&quot;,
119
- &quot;list.type.of.created.stylesheet&quot;: &quot;CSS&quot;,
120
- &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
121
- &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
122
- &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
123
- &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
124
- &quot;nodejs_interpreter_path&quot;: &quot;node&quot;,
125
- &quot;nodejs_package_manager_path&quot;: &quot;yarn&quot;,
126
- &quot;npm.build.executor&quot;: &quot;Run&quot;,
127
- &quot;npm.dev (1).executor&quot;: &quot;Run&quot;,
128
- &quot;npm.dev --open.executor&quot;: &quot;Run&quot;,
129
- &quot;npm.dev offline.executor&quot;: &quot;Run&quot;,
130
- &quot;npm.dev-offline.executor&quot;: &quot;Run&quot;,
131
- &quot;npm.dev.executor&quot;: &quot;Run&quot;,
132
- &quot;npm.to-dev.executor&quot;: &quot;Run&quot;,
133
- &quot;settings.editor.selected.configurable&quot;: &quot;preferences.general&quot;,
134
- &quot;ts.external.directory.path&quot;: &quot;C:\\Users\\Pumpkin\\Projects\\Web\\pineapple\\node_modules\\typescript\\lib&quot;,
135
- &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
111
+ <component name="PropertiesComponent"><![CDATA[{
112
+ "keyToString": {
113
+ "DefaultHtmlFileTemplate": "HTML File",
114
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
115
+ "RunOnceActivity.ShowReadmeOnStart": "true",
116
+ "WebServerToolWindowFactoryState": "false",
117
+ "git-widget-placeholder": "turnip/customizable2",
118
+ "ignore.virus.scanning.warn.message": "true",
119
+ "last_opened_file_path": "C:/Users/Pumpkin/Projects/Web/pineapple/src/lib/template/seaweed",
120
+ "list.type.of.created.stylesheet": "CSS",
121
+ "node.js.detected.package.eslint": "true",
122
+ "node.js.detected.package.tslint": "true",
123
+ "node.js.selected.package.eslint": "(autodetect)",
124
+ "node.js.selected.package.tslint": "(autodetect)",
125
+ "nodejs_interpreter_path": "node",
126
+ "nodejs_package_manager_path": "yarn",
127
+ "npm.build.executor": "Run",
128
+ "npm.dev (1).executor": "Run",
129
+ "npm.dev --open.executor": "Run",
130
+ "npm.dev offline.executor": "Run",
131
+ "npm.dev-offline.executor": "Run",
132
+ "npm.dev.executor": "Run",
133
+ "npm.to-dev.executor": "Run",
134
+ "settings.editor.selected.configurable": "preferences.general",
135
+ "ts.external.directory.path": "C:\\Users\\Pumpkin\\Projects\\Web\\pineapple\\node_modules\\typescript\\lib",
136
+ "vue.rearranger.settings.migration": "true"
136
137
  }
137
- }</component>
138
+ }]]></component>
138
139
  <component name="RecentsManager">
139
140
  <key name="CopyFile.RECENT_KEYS">
141
+ <recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\lib\template\seaweed" />
140
142
  <recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\lib\template\seaweed\entries" />
141
143
  <recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\(extra-pages)\page3\page7\(test_layout)\page8" />
142
144
  <recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\(extra-pages)\page3\page5" />
143
145
  <recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\routes\(pineapple)\pineapple\(extra-pages)\page2" />
144
- <recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\lib\components\navigation_component" />
145
146
  </key>
146
147
  <key name="MoveFile.RECENT_KEYS">
147
148
  <recent name="C:\Users\Pumpkin\Projects\Web\pineapple\src\lib\components\combo_box" />
@@ -329,15 +330,7 @@
329
330
  <workItem from="1712534451700" duration="490000" />
330
331
  <workItem from="1712535021202" duration="299000" />
331
332
  <workItem from="1712535434722" duration="522000" />
332
- <workItem from="1712536086680" duration="932000" />
333
- </task>
334
- <task id="LOCAL-00118" summary="Fix allowLinkedin arg in SocialSection">
335
- <option name="closed" value="true" />
336
- <created>1711683031188</created>
337
- <option name="number" value="00118" />
338
- <option name="presentableId" value="LOCAL-00118" />
339
- <option name="project" value="LOCAL" />
340
- <updated>1711683031188</updated>
333
+ <workItem from="1712536086680" duration="3391000" />
341
334
  </task>
342
335
  <task id="LOCAL-00119" summary="Change media to containre">
343
336
  <option name="closed" value="true" />
@@ -723,7 +716,15 @@
723
716
  <option name="project" value="LOCAL" />
724
717
  <updated>1712535169690</updated>
725
718
  </task>
726
- <option name="localTasksCounter" value="167" />
719
+ <task id="LOCAL-00167" summary="Move parseQtTerm on afterUpdate">
720
+ <option name="closed" value="true" />
721
+ <created>1712537061829</created>
722
+ <option name="number" value="00167" />
723
+ <option name="presentableId" value="LOCAL-00167" />
724
+ <option name="project" value="LOCAL" />
725
+ <updated>1712537061829</updated>
726
+ </task>
727
+ <option name="localTasksCounter" value="168" />
727
728
  <servers />
728
729
  </component>
729
730
  <component name="TypeScriptGeneratedFilesManager">
@@ -781,7 +782,6 @@
781
782
  </option>
782
783
  </component>
783
784
  <component name="VcsManagerConfiguration">
784
- <MESSAGE value="Add cdktf" />
785
785
  <MESSAGE value="Implement cdktf for empty AppService" />
786
786
  <MESSAGE value="WIP: cdktf" />
787
787
  <MESSAGE value="Revert &quot;Correct app_build_command in Azure SWA GithubActions&quot;&#10;&#10;Revert b34caf17" />
@@ -806,6 +806,7 @@
806
806
  <MESSAGE value="Put parseQTTerms in afterUpdate instead of onMount" />
807
807
  <MESSAGE value="Add logs to observe queryTermMap in downstream package" />
808
808
  <MESSAGE value="Add logs to observe parseQtTerms in downstream package" />
809
- <option name="LAST_COMMIT_MESSAGE" value="Add logs to observe parseQtTerms in downstream package" />
809
+ <MESSAGE value="Move parseQtTerm on afterUpdate" />
810
+ <option name="LAST_COMMIT_MESSAGE" value="Move parseQtTerm on afterUpdate" />
810
811
  </component>
811
812
  </project>
@@ -0,0 +1 @@
1
+ export declare const parseQueryTerms: (node: Element, querySet: Set<string>) => void;
@@ -0,0 +1,23 @@
1
+ export const parseQueryTerms = (node, querySet) => {
2
+ // change all text content to gibberish
3
+ for (const child of Array.from(node.children)) {
4
+ if (child.nodeType === Node.ELEMENT_NODE) {
5
+ parseQueryTerms(child, querySet);
6
+ // todo: if it's a span and it wraps a word, and qt class then we count that as query
7
+ // for (const childOfChild of child.childNodes) {
8
+ // if (childOfChild.nodeType === Node.TEXT_NODE && childOfChild.textContent?.trim()) {
9
+ // // todo analyze textcontent
10
+ // }
11
+ // }
12
+ // Warning: below is not redundant and is a catch-all
13
+ // Long-term solution: figure out the correct typing
14
+ if ((typeof child.className === "string") && child.className?.includes("qt-")) {
15
+ child.className.split(" ").forEach(c => {
16
+ if (c.startsWith("qt-")) {
17
+ querySet.add(c);
18
+ }
19
+ });
20
+ }
21
+ }
22
+ }
23
+ };
@@ -1,4 +1,4 @@
1
- <script>import { onMount, afterUpdate } from "svelte";
1
+ <script>import { afterUpdate, onMount } from "svelte";
2
2
  import EntryOrderConfig from "./entry_order_config/EntryOrderConfig.svelte";
3
3
  import { runChaos } from "./RunChaos";
4
4
  import SocialSection from "../../components/SocialSection.svelte";
@@ -8,13 +8,13 @@ import { Accordion, AccordionItem, CodeBlock, SlideToggle } from "@skeletonlabs/
8
8
  import { page } from "$app/stores";
9
9
  import Card from "../../components/Card.svelte";
10
10
  import ElementVisbilityDetector from "../../components/ElementVisbilityDetector.svelte";
11
- import selfContent from "./SeaweedTemplate.svelte?raw";
12
11
  import {
13
12
  AllGroupedEntriesProjectFirst,
14
13
  GetEntryFromGlobal,
15
14
  seaweedTemplateData,
16
15
  TurnGroupEntriesMutable
17
16
  } from "./SeaweedTemplateData";
17
+ import { parseQueryTerms } from "./ParseQueryTerms";
18
18
  export let letChaos = true;
19
19
  export let name = "Turnip";
20
20
  export let email = "turnipxenon@gmail.com";
@@ -25,7 +25,6 @@ export let extraComponent = void 0;
25
25
  const entryProps = {
26
26
  email
27
27
  };
28
- const entryList = import.meta.glob("./entries/*.svelte", { query: "?raw", eager: true });
29
28
  const paramQTSet = /* @__PURE__ */ new Set();
30
29
  let isVisible = true;
31
30
  let isAdvanceSettingOn = false;
@@ -46,25 +45,9 @@ const syncQT = () => {
46
45
  });
47
46
  seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
48
47
  };
49
- const parseQTTerms = async () => {
50
- console.log("parsing", seaweedTemplateData.queryTermMap.size);
48
+ const parseQueryTermsLocal = async () => {
51
49
  const qtSet = /* @__PURE__ */ new Set();
52
- const rawTermList = [];
53
- [...Object.values(entryList).map((e) => e.default), selfContent].forEach((body) => {
54
- console.log("parsing", body);
55
- rawTermList.push(
56
- ...body.split('"').filter((s) => s.startsWith("qt-"))
57
- // step 2: filter out texts that does not begin with "qt-"
58
- );
59
- });
60
- rawTermList.forEach((t) => {
61
- t.split(" ").forEach((nt) => {
62
- if (["qt-1", "qt-2", "qt-*", "qt-"].includes(nt)) {
63
- return;
64
- }
65
- qtSet.add(nt);
66
- });
67
- });
50
+ parseQueryTerms(document.body, qtSet);
68
51
  qtSet.forEach((t) => seaweedTemplateData.queryTermMap.set(t, true));
69
52
  seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
70
53
  syncQT();
@@ -132,7 +115,7 @@ let isParsed = false;
132
115
  afterUpdate(async () => {
133
116
  if (!letChaos && !isParsed) {
134
117
  isParsed = true;
135
- await parseQTTerms();
118
+ await parseQueryTermsLocal();
136
119
  }
137
120
  });
138
121
  const toggleTerm = (term) => {
@@ -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: "fbxgvv"
24
+ version_hash: "kjai7p"
25
25
  };
26
26
 
27
27
  export async function get_hooks() {
@@ -0,0 +1 @@
1
+ export declare const parseQueryTerms: (node: Element, querySet: Set<string>) => void;
@@ -0,0 +1,23 @@
1
+ export const parseQueryTerms = (node, querySet) => {
2
+ // change all text content to gibberish
3
+ for (const child of Array.from(node.children)) {
4
+ if (child.nodeType === Node.ELEMENT_NODE) {
5
+ parseQueryTerms(child, querySet);
6
+ // todo: if it's a span and it wraps a word, and qt class then we count that as query
7
+ // for (const childOfChild of child.childNodes) {
8
+ // if (childOfChild.nodeType === Node.TEXT_NODE && childOfChild.textContent?.trim()) {
9
+ // // todo analyze textcontent
10
+ // }
11
+ // }
12
+ // Warning: below is not redundant and is a catch-all
13
+ // Long-term solution: figure out the correct typing
14
+ if ((typeof child.className === "string") && child.className?.includes("qt-")) {
15
+ child.className.split(" ").forEach(c => {
16
+ if (c.startsWith("qt-")) {
17
+ querySet.add(c);
18
+ }
19
+ });
20
+ }
21
+ }
22
+ }
23
+ };
@@ -1,4 +1,4 @@
1
- <script>import { onMount, afterUpdate } from "svelte";
1
+ <script>import { afterUpdate, onMount } from "svelte";
2
2
  import EntryOrderConfig from "./entry_order_config/EntryOrderConfig.svelte";
3
3
  import { runChaos } from "./RunChaos";
4
4
  import SocialSection from "../../components/SocialSection.svelte";
@@ -8,13 +8,13 @@ import { Accordion, AccordionItem, CodeBlock, SlideToggle } from "@skeletonlabs/
8
8
  import { page } from "$app/stores";
9
9
  import Card from "../../components/Card.svelte";
10
10
  import ElementVisbilityDetector from "../../components/ElementVisbilityDetector.svelte";
11
- import selfContent from "./SeaweedTemplate.svelte?raw";
12
11
  import {
13
12
  AllGroupedEntriesProjectFirst,
14
13
  GetEntryFromGlobal,
15
14
  seaweedTemplateData,
16
15
  TurnGroupEntriesMutable
17
16
  } from "./SeaweedTemplateData";
17
+ import { parseQueryTerms } from "./ParseQueryTerms";
18
18
  export let letChaos = true;
19
19
  export let name = "Turnip";
20
20
  export let email = "turnipxenon@gmail.com";
@@ -25,7 +25,6 @@ export let extraComponent = void 0;
25
25
  const entryProps = {
26
26
  email
27
27
  };
28
- const entryList = import.meta.glob("./entries/*.svelte", { query: "?raw", eager: true });
29
28
  const paramQTSet = /* @__PURE__ */ new Set();
30
29
  let isVisible = true;
31
30
  let isAdvanceSettingOn = false;
@@ -46,25 +45,9 @@ const syncQT = () => {
46
45
  });
47
46
  seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
48
47
  };
49
- const parseQTTerms = async () => {
50
- console.log("parsing", seaweedTemplateData.queryTermMap.size);
48
+ const parseQueryTermsLocal = async () => {
51
49
  const qtSet = /* @__PURE__ */ new Set();
52
- const rawTermList = [];
53
- [...Object.values(entryList).map((e) => e.default), selfContent].forEach((body) => {
54
- console.log("parsing", body);
55
- rawTermList.push(
56
- ...body.split('"').filter((s) => s.startsWith("qt-"))
57
- // step 2: filter out texts that does not begin with "qt-"
58
- );
59
- });
60
- rawTermList.forEach((t) => {
61
- t.split(" ").forEach((nt) => {
62
- if (["qt-1", "qt-2", "qt-*", "qt-"].includes(nt)) {
63
- return;
64
- }
65
- qtSet.add(nt);
66
- });
67
- });
50
+ parseQueryTerms(document.body, qtSet);
68
51
  qtSet.forEach((t) => seaweedTemplateData.queryTermMap.set(t, true));
69
52
  seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
70
53
  syncQT();
@@ -132,7 +115,7 @@ let isParsed = false;
132
115
  afterUpdate(async () => {
133
116
  if (!letChaos && !isParsed) {
134
117
  isParsed = true;
135
- await parseQTTerms();
118
+ await parseQueryTermsLocal();
136
119
  }
137
120
  });
138
121
  const toggleTerm = (term) => {
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.53",
4
+ "version": "2.4.54",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && yarn package",
@@ -0,0 +1,26 @@
1
+ export const parseQueryTerms = (node: Element, querySet: Set<string>) => {
2
+ // change all text content to gibberish
3
+ for (const child of Array.from(node.children)) {
4
+ if (child.nodeType === Node.ELEMENT_NODE) {
5
+ parseQueryTerms(child, querySet);
6
+ // todo: if it's a span and it wraps a word, and qt class then we count that as query
7
+ // for (const childOfChild of child.childNodes) {
8
+ // if (childOfChild.nodeType === Node.TEXT_NODE && childOfChild.textContent?.trim()) {
9
+ // // todo analyze textcontent
10
+ // }
11
+ // }
12
+
13
+ // Warning: below is not redundant and is a catch-all
14
+ // Long-term solution: figure out the correct typing
15
+ if ((typeof child.className === "string") && child.className?.includes("qt-")) {
16
+ child.className.split(" ").forEach(c => {
17
+
18
+ if (c.startsWith("qt-")) {
19
+ querySet.add(c);
20
+ }
21
+
22
+ });
23
+ }
24
+ }
25
+ }
26
+ };
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { type ComponentType, onMount, afterUpdate } from "svelte";
2
+ import { afterUpdate, type ComponentType, onMount } from "svelte";
3
3
  import EntryOrderConfig from "$pkg/template/seaweed/entry_order_config/EntryOrderConfig.svelte";
4
4
  import { runChaos } from "$pkg/template/seaweed/RunChaos";
5
5
  import SocialSection from "$pkg/components/SocialSection.svelte";
@@ -9,7 +9,6 @@
9
9
  import { page } from "$app/stores";
10
10
  import Card from "$pkg/components/Card.svelte";
11
11
  import ElementVisbilityDetector from "$pkg/components/ElementVisbilityDetector.svelte";
12
- import selfContent from "./SeaweedTemplate.svelte?raw";
13
12
  import {
14
13
  AllGroupedEntriesProjectFirst,
15
14
  type EntryGroup,
@@ -19,7 +18,7 @@
19
18
  TurnGroupEntriesMutable
20
19
  } from "./SeaweedTemplateData";
21
20
  import type { EntryProps } from "$pkg/template/seaweed/entries/EntryProps";
22
- import type { RawGlob } from "$pkg/util/util";
21
+ import { parseQueryTerms } from "$pkg/template/seaweed/ParseQueryTerms";
23
22
 
24
23
  export let letChaos = true;
25
24
  export let name = "Turnip";
@@ -34,7 +33,6 @@
34
33
  email
35
34
  };
36
35
 
37
- const entryList = import.meta.glob("./entries/*.svelte", { query: "?raw", eager: true });
38
36
  const paramQTSet = new Set<string>();
39
37
 
40
38
  let isVisible = true;
@@ -61,36 +59,9 @@
61
59
  seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
62
60
  };
63
61
 
64
- const parseQTTerms = async () => {
65
- console.log("parsing", seaweedTemplateData.queryTermMap.size);
62
+ const parseQueryTermsLocal = async () => {
66
63
  const qtSet = new Set<string>();
67
- const rawTermList: string[] = [];
68
- [...Object.values(entryList).map(e => (e as RawGlob).default), selfContent].forEach(body => {
69
- // parse the qt-* term which exists within elements like:
70
- // <span class="qt-*">TERM</span>
71
- console.log("parsing", body);
72
- rawTermList.push(
73
- ...body // step 3: destructure the array
74
- .split("\"") // step 1: split the text as double quotations (") as the delimiter
75
- .filter(s => s.startsWith("qt-")) // step 2: filter out texts that does not begin with "qt-"
76
- );
77
- });
78
-
79
- // step 4: some spans contain multiple classes, split them up
80
- // then add them to qtTerms
81
- // e.g. <span class="qt-1 qt-2">TERM</span>
82
- rawTermList.forEach(t => {
83
- t.split(" ").forEach(nt => {
84
- // filter out some of this meta terms
85
- if (["qt-1", "qt-2", "qt-*", "qt-"].includes(nt)) {
86
- return;
87
- }
88
-
89
- // adding to set ensures the entry is unique
90
- qtSet.add(nt);
91
- });
92
- });
93
-
64
+ parseQueryTerms(document.body, qtSet);
94
65
  qtSet.forEach(t => seaweedTemplateData.queryTermMap.set(t, true));
95
66
  // force svelte update
96
67
  seaweedTemplateData.queryTermMap = seaweedTemplateData.queryTermMap;
@@ -194,7 +165,7 @@
194
165
  afterUpdate(async () => {
195
166
  if (!letChaos && !isParsed) {
196
167
  isParsed = true;
197
- await parseQTTerms();
168
+ await parseQueryTermsLocal();
198
169
  }
199
170
  });
200
171