@turnipxenon/pineapple 5.0.0-alpha.10 → 5.0.0-alpha.12
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/dist/styles/app.css +0 -82
- package/dist/styles/tailwind.css +0 -12
- package/dist/styles/turnip-theme.css +1 -0
- package/dist/ui/components/MeltToaster/MeltToaster.svelte +4 -1
- package/dist/ui/components/MeltToaster/MeltToaster.svelte.d.ts.map +1 -1
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte +161 -18
- package/dist/ui/elements/CodeBlock/CodeBlock.svelte.d.ts.map +1 -1
- package/dist/ui/modules/universal-overlay/SettingsPanel.svelte +5 -4
- package/dist/ui/modules/universal-overlay/SettingsPanel.svelte.d.ts.map +1 -1
- package/dist/ui/modules/universal-overlay/UniversalOverlay.svelte +1 -1
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte +18 -9
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte.d.ts +1 -1
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte.d.ts.map +1 -1
- package/dist/ui/templates/blog_template/BlogTemplate.svelte +5 -2
- package/dist/ui/templates/blog_template/BlogTemplate.svelte.d.ts.map +1 -1
- package/dist/ui/templates/pinya-base/PinyaBase.svelte +27 -1
- package/dist/ui/templates/pinya-base/PinyaBase.svelte.d.ts +8 -3
- package/dist/ui/templates/pinya-base/PinyaBase.svelte.d.ts.map +1 -1
- package/dist/ui/templates/pinya-base/menuPageServerLoadRemote.remote.svelte +1 -0
- package/dist/ui/templates/pinya-base/menuPageServerLoadRemote.remote.svelte.d.ts +27 -0
- package/dist/ui/templates/pinya-base/menuPageServerLoadRemote.remote.svelte.d.ts.map +1 -0
- package/dist/util/context/PineappleBaseContext.svelte +9 -11
- package/dist/util/context/PineappleBaseContext.svelte.d.ts.map +1 -1
- package/dist/util/context/pineappleBaseContextDefinitions.svelte.d.ts +27 -14
- package/dist/util/context/pineappleBaseContextDefinitions.svelte.d.ts.map +1 -1
- package/dist/util/context/pineappleBaseContextDefinitions.svelte.js +22 -31
- package/dist/util/localStore.svelte.d.ts +10 -3
- package/dist/util/localStore.svelte.d.ts.map +1 -1
- package/dist/util/localStore.svelte.js +56 -38
- package/package.json +11 -8
- package/src/lib/styles/app.css +0 -82
package/dist/styles/app.css
CHANGED
|
@@ -76,88 +76,6 @@ a.external-link {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/*https://shiki.style/guide/dual-themes*/
|
|
80
|
-
html.dark .shiki,
|
|
81
|
-
html.dark .shiki span {
|
|
82
|
-
color: var(--shiki-dark) !important;
|
|
83
|
-
background-color: var(--shiki-dark-bg) !important;
|
|
84
|
-
/* Optional, if you also want font styles */
|
|
85
|
-
font-style: var(--shiki-dark-font-style) !important;
|
|
86
|
-
font-weight: var(--shiki-dark-font-weight) !important;
|
|
87
|
-
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.inline-code {
|
|
91
|
-
background-color: aliceblue;
|
|
92
|
-
padding: 0.2rem;
|
|
93
|
-
border-radius: 0.2rem;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
html.dark .inline-code {
|
|
97
|
-
background-color: #303446;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.shiki {
|
|
101
|
-
span {
|
|
102
|
-
white-space: pre-wrap;
|
|
103
|
-
word-wrap: break-word;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* region shiki copy button */
|
|
108
|
-
pre:has(code) {
|
|
109
|
-
position: relative;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
pre button.copy {
|
|
113
|
-
position: absolute;
|
|
114
|
-
right: 16px;
|
|
115
|
-
top: 16px;
|
|
116
|
-
height: 28px;
|
|
117
|
-
width: 28px;
|
|
118
|
-
padding: 0;
|
|
119
|
-
display: flex;
|
|
120
|
-
|
|
121
|
-
& span {
|
|
122
|
-
width: 100%;
|
|
123
|
-
aspect-ratio: 1 / 1;
|
|
124
|
-
background-repeat: no-repeat;
|
|
125
|
-
background-position: center;
|
|
126
|
-
background-size: cover;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
& .ready {
|
|
130
|
-
background-image: url("$pkg/assets/icons/icon-copy-light-contrast.svg");
|
|
131
|
-
/*todo*/
|
|
132
|
-
/*@variant dark {*/
|
|
133
|
-
/* background-image: url("$pkg/assets/icons/icon-copy-dark-contrast.svg");*/
|
|
134
|
-
/*}*/
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
& .success {
|
|
138
|
-
display: none;
|
|
139
|
-
background-image: url("$pkg/assets/icons/icon-check-light-contrast.svg");
|
|
140
|
-
|
|
141
|
-
/*todo: migration*/
|
|
142
|
-
/*@variant dark {*/
|
|
143
|
-
/* background-image: url("$pkg/assets/icons/icon-check-dark-contrast.svg");*/
|
|
144
|
-
/*}*/
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&.copied {
|
|
148
|
-
& .success {
|
|
149
|
-
display: block;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
& .ready {
|
|
153
|
-
display: none;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/* endregion shiki copy button */
|
|
159
|
-
|
|
160
|
-
|
|
161
79
|
ul + h2, ol + h2 {
|
|
162
80
|
margin-top: 1rlh;
|
|
163
81
|
}
|
package/dist/styles/tailwind.css
CHANGED
|
@@ -536,9 +536,6 @@
|
|
|
536
536
|
.ig-textarea::placeholder {
|
|
537
537
|
color:var(--color-surface-700-300)
|
|
538
538
|
}
|
|
539
|
-
::selection {
|
|
540
|
-
background-color:#73737380
|
|
541
|
-
}
|
|
542
539
|
:disabled,
|
|
543
540
|
.disabled {
|
|
544
541
|
opacity:.5
|
|
@@ -2715,15 +2712,6 @@ a.external-link {
|
|
|
2715
2712
|
#toast-progress::-moz-progress-bar {
|
|
2716
2713
|
background:rgba(var(--color-secondary-500))
|
|
2717
2714
|
}
|
|
2718
|
-
html.dark .shiki,
|
|
2719
|
-
html.dark .shiki span {
|
|
2720
|
-
color:var(--shiki-dark)!important;
|
|
2721
|
-
background-color:var(--shiki-dark-bg)!important;
|
|
2722
|
-
font-style:var(--shiki-dark-font-style)!important;
|
|
2723
|
-
font-weight:var(--shiki-dark-font-weight)!important;
|
|
2724
|
-
-webkit-text-decoration:var(--shiki-dark-text-decoration)!important;
|
|
2725
|
-
text-decoration:var(--shiki-dark-text-decoration)!important
|
|
2726
|
-
}
|
|
2727
2715
|
.inline-code {
|
|
2728
2716
|
background-color:#f0f8ff;
|
|
2729
2717
|
border-radius:.2rem;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
|
+
import { browser } from "$app/environment";
|
|
14
15
|
import { onDestroy, onMount } from "svelte";
|
|
15
16
|
|
|
16
17
|
let toasterRoot: HTMLDivElement;
|
|
@@ -39,7 +40,9 @@
|
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
onDestroy(() => {
|
|
42
|
-
if (
|
|
43
|
+
if (browser) {
|
|
44
|
+
if (observer) observer.disconnect();
|
|
45
|
+
}
|
|
43
46
|
});
|
|
44
47
|
</script>
|
|
45
48
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeltToaster.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/components/MeltToaster/MeltToaster.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"MeltToaster.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/components/MeltToaster/MeltToaster.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmB,CAAC;AAgE1C;;;;GAIG;AACH,QAAA,MAAM,WAAW,2DAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
<!-- @component Code Block based on: https://shiki.style/ and https://www.skeleton.dev/docs/integrations/code-block/svelte/ -->
|
|
2
2
|
|
|
3
3
|
<script module lang="ts">
|
|
4
|
+
import { transformerNotationDiff } from "@shikijs/transformers";
|
|
4
5
|
import { addCopyButton } from "shiki-transformer-copy-button";
|
|
5
6
|
import { createHighlighterCoreSync } from "shiki/core";
|
|
6
7
|
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
7
|
-
// Themes
|
|
8
|
-
// https://shiki.style/themes
|
|
9
|
-
import themeLight from "shiki/themes/catppuccin-latte.mjs";
|
|
10
|
-
import themeDark from "shiki/themes/catppuccin-frappe.mjs";
|
|
11
8
|
// Languages
|
|
12
9
|
// https://shiki.style/languages
|
|
13
|
-
import
|
|
14
|
-
import html from "shiki/langs/html.mjs";
|
|
10
|
+
import shikiConsole from "shiki/langs/console.mjs";
|
|
15
11
|
import css from "shiki/langs/css.mjs";
|
|
12
|
+
import html from "shiki/langs/html.mjs";
|
|
16
13
|
import js from "shiki/langs/javascript.mjs";
|
|
17
|
-
import
|
|
14
|
+
import json from "shiki/langs/json.mjs";
|
|
18
15
|
import markdown from "shiki/langs/markdown.mjs";
|
|
19
|
-
import xml from "shiki/langs/xml.mjs";
|
|
20
16
|
import svelte from "shiki/langs/svelte.mjs";
|
|
17
|
+
import ts from "shiki/langs/typescript.mjs";
|
|
18
|
+
import xml from "shiki/langs/xml.mjs";
|
|
19
|
+
// Themes
|
|
20
|
+
// https://shiki.style/themes
|
|
21
|
+
import themeDark from "shiki/themes/catppuccin-frappe.mjs";
|
|
22
|
+
import themeLight from "shiki/themes/catppuccin-latte.mjs";
|
|
21
23
|
|
|
22
24
|
// https://shiki.style/guide/sync-usage
|
|
23
25
|
const shiki = createHighlighterCoreSync({
|
|
@@ -25,11 +27,12 @@
|
|
|
25
27
|
// Implement your import theme.
|
|
26
28
|
themes: [themeLight, themeDark],
|
|
27
29
|
// Implement your imported and supported languages.
|
|
28
|
-
langs: [
|
|
30
|
+
langs: [shikiConsole, html, css, js, ts, markdown, xml, svelte, json]
|
|
29
31
|
});
|
|
30
32
|
</script>
|
|
31
33
|
|
|
32
34
|
<script lang="ts">
|
|
35
|
+
import { onMount } from "svelte";
|
|
33
36
|
import type { CodeBlockProps } from "./CodeBlockProps";
|
|
34
37
|
|
|
35
38
|
let {
|
|
@@ -54,6 +57,7 @@
|
|
|
54
57
|
dark: "catppuccin-frappe"
|
|
55
58
|
},
|
|
56
59
|
transformers: [
|
|
60
|
+
transformerNotationDiff(),
|
|
57
61
|
addCopyButton({ toggle: 2000 })
|
|
58
62
|
]
|
|
59
63
|
}));
|
|
@@ -67,13 +71,152 @@
|
|
|
67
71
|
</div>
|
|
68
72
|
|
|
69
73
|
<style>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
:global {
|
|
75
|
+
.pinya-code-block {
|
|
76
|
+
margin-bottom: 1rlh;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/*https://shiki.style/guide/dual-themes*/
|
|
80
|
+
|
|
81
|
+
html.dark .shiki,
|
|
82
|
+
html.dark .shiki > span {
|
|
83
|
+
color: var(--shiki-dark);
|
|
84
|
+
background-color: var(--shiki-dark-bg);
|
|
85
|
+
/* Optional, if you also want font styles */
|
|
86
|
+
font-style: var(--shiki-dark-font-style);
|
|
87
|
+
font-weight: var(--shiki-dark-font-weight);
|
|
88
|
+
text-decoration: var(--shiki-dark-text-decoration);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
html.dark .shiki {
|
|
93
|
+
color: var(--shiki-dark) !important;
|
|
94
|
+
background-color: var(--shiki-dark-bg) !important;
|
|
95
|
+
font-style: var(--shiki-dark-font-style) !important;
|
|
96
|
+
font-weight: var(--shiki-dark-font-weight) !important;
|
|
97
|
+
-webkit-text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
98
|
+
text-decoration: var(--shiki-dark-text-decoration) !important
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
html.dark .shiki.has-diff span.diff.add {
|
|
102
|
+
background-color: rgba(0, 255, 0, 0.05);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.inline-code {
|
|
106
|
+
background-color: aliceblue;
|
|
107
|
+
padding: 0.2rem;
|
|
108
|
+
border-radius: 0.2rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.shiki {
|
|
112
|
+
span {
|
|
113
|
+
white-space: pre-wrap;
|
|
114
|
+
word-wrap: break-word;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.has-diff {
|
|
118
|
+
padding-inline-start: 0;
|
|
119
|
+
padding-inline-end: 0;
|
|
120
|
+
|
|
121
|
+
code {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
gap: 0.2lh;
|
|
125
|
+
|
|
126
|
+
& > span {
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-wrap: wrap;
|
|
129
|
+
padding-inline-start: 2em;
|
|
130
|
+
padding-inline-end: 1em;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
span.diff.remove {
|
|
135
|
+
background-color: rgba(255, 0, 0, 0.15);
|
|
136
|
+
|
|
137
|
+
&::before {
|
|
138
|
+
display: block;
|
|
139
|
+
position: absolute;
|
|
140
|
+
content: "-";
|
|
141
|
+
margin-inline-start: calc((var(--spacing) * -4) - 2em);
|
|
142
|
+
padding-inline-start: 1.75em;
|
|
143
|
+
font-weight: bold;
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
span.diff.add {
|
|
149
|
+
background-color: rgba(0, 255, 0, 0.15);
|
|
150
|
+
|
|
151
|
+
&::before {
|
|
152
|
+
display: block;
|
|
153
|
+
position: absolute;
|
|
154
|
+
content: "+";
|
|
155
|
+
margin-inline-start: calc((var(--spacing) * -4) - 2em);
|
|
156
|
+
padding-inline-start: 1.75em;
|
|
157
|
+
font-weight: bold;
|
|
158
|
+
pointer-events: none;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* region shiki copy button */
|
|
165
|
+
|
|
166
|
+
pre:has(code) {
|
|
167
|
+
position: relative;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
pre button.copy {
|
|
171
|
+
position: absolute;
|
|
172
|
+
right: 16px;
|
|
173
|
+
top: 16px;
|
|
174
|
+
height: 28px;
|
|
175
|
+
width: 28px;
|
|
176
|
+
padding: 0;
|
|
177
|
+
display: flex;
|
|
178
|
+
|
|
179
|
+
& span {
|
|
180
|
+
width: 100%;
|
|
181
|
+
aspect-ratio: 1 / 1;
|
|
182
|
+
background-repeat: no-repeat;
|
|
183
|
+
background-position: center;
|
|
184
|
+
background-size: cover;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
& .ready {
|
|
188
|
+
background-image: url("$pkg/assets/icons/icon-copy-light-contrast.svg");
|
|
189
|
+
/*todo*/
|
|
190
|
+
/*@variant dark {*/
|
|
191
|
+
/* background-image: url("$pkg/assets/icons/icon-copy-dark-contrast.svg");*/
|
|
192
|
+
/*}*/
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
& .success {
|
|
196
|
+
display: none;
|
|
197
|
+
background-image: url("$pkg/assets/icons/icon-check-light-contrast.svg");
|
|
198
|
+
|
|
199
|
+
/*todo: migration*/
|
|
200
|
+
/*@variant dark {*/
|
|
201
|
+
/* background-image: url("$pkg/assets/icons/icon-check-dark-contrast.svg");*/
|
|
202
|
+
/*}*/
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&.copied {
|
|
206
|
+
& .success {
|
|
207
|
+
display: block;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
& .ready {
|
|
211
|
+
display: none;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* endregion shiki copy button */
|
|
217
|
+
|
|
218
|
+
h2 + .pinya-code-block {
|
|
219
|
+
margin-top: 0.5rlh;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
79
222
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/CodeBlock/CodeBlock.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/elements/CodeBlock/CodeBlock.svelte.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA+CvD,kHAAkH;AAClH,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -17,6 +17,7 @@ TODO: delete GeneralSettingsModal.svelte
|
|
|
17
17
|
getEnableDialogPreferenceContext,
|
|
18
18
|
getEnablePortraitContext
|
|
19
19
|
} from "../../../util/context/pineappleBaseContextDefinitions.svelte";
|
|
20
|
+
import type { LocalStore } from "../../../util/localStore.svelte";
|
|
20
21
|
import { setMode, userPrefersMode } from "mode-watcher";
|
|
21
22
|
|
|
22
23
|
interface ToggleItem {
|
|
@@ -98,19 +99,19 @@ TODO: delete GeneralSettingsModal.svelte
|
|
|
98
99
|
<div class="switch-default">
|
|
99
100
|
<PineappleSwitch
|
|
100
101
|
name="conversation-preference"
|
|
101
|
-
bind:checked={
|
|
102
|
+
bind:checked={enableDialogPreference.value}>
|
|
102
103
|
</PineappleSwitch>
|
|
103
104
|
<label for="conversation-preference">
|
|
104
|
-
Conversation preference: {
|
|
105
|
+
Conversation preference: {enableDialogPreference.value ? "Always on" : "Always off"}
|
|
105
106
|
</label>
|
|
106
107
|
</div>
|
|
107
108
|
<div class="switch-default">
|
|
108
109
|
<PineappleSwitch
|
|
109
110
|
name="portrait-preference"
|
|
110
|
-
bind:checked={
|
|
111
|
+
bind:checked={enablePortraitContext.value}>
|
|
111
112
|
</PineappleSwitch>
|
|
112
113
|
<label for="portrait-preference">
|
|
113
|
-
Show conversation portrait: {
|
|
114
|
+
Show conversation portrait: {enablePortraitContext.value ? "Always on" : "Always off"}
|
|
114
115
|
</label>
|
|
115
116
|
</div>
|
|
116
117
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/universal-overlay/SettingsPanel.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsPanel.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/modules/universal-overlay/SettingsPanel.svelte.ts"],"names":[],"mappings":"AAqHA;;;;GAIG;AACH,QAAA,MAAM,aAAa,2DAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -60,7 +60,7 @@ See panels:
|
|
|
60
60
|
hidden={isHidden}
|
|
61
61
|
style="--hidePercentWidth: -{hidePercent}vw;
|
|
62
62
|
--hidePercentHeight: {hidePercentLinear}vh;">
|
|
63
|
-
<div class="dialog-portrait-container" class:is-portrait-enabled={
|
|
63
|
+
<div class="dialog-portrait-container" class:is-portrait-enabled={enablePortrait.value}>
|
|
64
64
|
<img src={currentPortrait} alt="Ares" class="dialog-portrait" />
|
|
65
65
|
</div>
|
|
66
66
|
<div id="main-dialog-box-container">
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import { dialogManager } from "../../..";
|
|
5
5
|
import AresLogo from "../../../assets/characters/ares/ares_logo.webp";
|
|
6
|
-
import SettingsLogo from "../../../assets/icons/icon-settings.svg";
|
|
7
|
-
import HamburgerIcon from "../../../assets/icons/icon-menu.svg";
|
|
8
6
|
import DialogIcon from "../../../assets/icons/icon-chat.svg";
|
|
7
|
+
import HamburgerIcon from "../../../assets/icons/icon-menu.svg";
|
|
8
|
+
import SettingsLogo from "../../../assets/icons/icon-settings.svg";
|
|
9
9
|
|
|
10
10
|
import { m } from "../../../external/paraglide/messages";
|
|
11
11
|
import { localizeHref } from "../../../external/paraglide/runtime";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import NavigationModal from "../../modules/modals/general-settings/NavigationModal.svelte";
|
|
17
17
|
import UniversalOverlay from "../../modules/universal-overlay/UniversalOverlay.svelte";
|
|
18
18
|
import { getEnableDialogOverlayContext } from "../../../util/context/pineappleBaseContextDefinitions.svelte";
|
|
19
|
-
import type
|
|
19
|
+
import { onMount, type Snippet } from "svelte";
|
|
20
20
|
import { modals } from "svelte-modals";
|
|
21
21
|
import PinyaButton from "../../elements/PinyaButton/PinyaButton.svelte";
|
|
22
22
|
import { appState } from "./pinyaPageLayoutRunes.svelte.js";
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
const onSettingsClick = () => {
|
|
39
39
|
modals.open(GeneralSettingsModal);
|
|
40
40
|
};
|
|
41
|
+
|
|
42
|
+
let isMounted = $state(false);
|
|
43
|
+
onMount(() => {
|
|
44
|
+
isMounted = true;
|
|
45
|
+
});
|
|
41
46
|
</script>
|
|
42
47
|
|
|
43
48
|
{#snippet header(extraClass: string)}
|
|
@@ -94,12 +99,12 @@
|
|
|
94
99
|
>
|
|
95
100
|
<ImageIcon src={SettingsLogo} aria-hidden="true" alt=""></ImageIcon>
|
|
96
101
|
</PinyaButton>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
<PinyaButton
|
|
103
|
+
title="Toggle conversation"
|
|
104
|
+
buttonVariant={ButtonVariant.Image}
|
|
105
|
+
colorScheme={isMounted && enableUniversalOverlay.value ? ColorScheme.Secondary : undefined}
|
|
106
|
+
onclick={()=>{dialogManager.toggleDialogOverlay();}}
|
|
107
|
+
>
|
|
103
108
|
<ImageIcon src={DialogIcon} aria-hidden="true" alt=""></ImageIcon>
|
|
104
109
|
</PinyaButton>
|
|
105
110
|
</div>
|
|
@@ -127,6 +132,10 @@
|
|
|
127
132
|
|
|
128
133
|
<style>
|
|
129
134
|
:global {
|
|
135
|
+
.hidden {
|
|
136
|
+
opacity: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
130
139
|
#header-action-wrapper {
|
|
131
140
|
max-height: 2rem;
|
|
132
141
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinyaPageLayout.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PinyaPageLayout.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAK9C,KAAK,gBAAgB,GAAI;IACxB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,SAAS,GAAG,YAAY,CAAA;CAC1C,CAAC;AA8GH,QAAA,MAAM,eAAe,gEAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import "./blog-template.css";
|
|
5
|
+
import { browser } from "$app/environment";
|
|
5
6
|
import { setIgnoreOverlayOverride } from "../../../util/context/pineappleBaseContextDefinitions.svelte";
|
|
6
7
|
import { onDestroy, onMount, type Snippet } from "svelte";
|
|
7
8
|
import BlogTemplateInner from "./BlogTemplateInner.svelte";
|
|
@@ -37,8 +38,10 @@
|
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
onDestroy(() => {
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
if (browser) {
|
|
42
|
+
appState.bgOpacity = 1;
|
|
43
|
+
enableUniversalOverlaySvelte4.set(initialDialogState);
|
|
44
|
+
}
|
|
42
45
|
});
|
|
43
46
|
|
|
44
47
|
appState.bgOpacity = shouldFillWholePage ? 0.2 : 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogTemplate.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/blog_template/BlogTemplate.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"BlogTemplate.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/blog_template/BlogTemplate.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;AAG7B,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAO1E,UAAU,KAAK;IACd,QAAQ,EAAE,cAAc,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AA4DF,QAAA,MAAM,YAAY,2CAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { page } from "$app/state";
|
|
3
|
+
import { menuPageServerLoad, type PageMeta, parsePageMetaNested } from "../../..";
|
|
3
4
|
import WebThumbnailImage from "../../../assets/placeholder/placeholder_circle.png";
|
|
4
5
|
import { locales, localizeHref } from "../../../external/paraglide/runtime";
|
|
5
6
|
import "../../../styles/global.css";
|
|
6
7
|
import MeltToaster from "../../components/MeltToaster/MeltToaster.svelte";
|
|
7
8
|
import type { PinyaHead } from "./pinyaBaseRunes.svelte.js";
|
|
8
9
|
import PineappleBaseContext from "../../../util/context/PineappleBaseContext.svelte";
|
|
10
|
+
import { setSiteLayout } from "../../../util/context/pineappleBaseContextDefinitions.svelte";
|
|
9
11
|
import { ModeWatcher } from "mode-watcher";
|
|
10
12
|
import "../../../styles/app.css";
|
|
13
|
+
import { onMount, type Snippet } from "svelte";
|
|
11
14
|
import { Modals } from "svelte-modals";
|
|
15
|
+
import { getParsnipDataRemote } from "../../../../routes/(pineapple)/pineapple/getParsnipData.remote";
|
|
12
16
|
|
|
13
|
-
let { children } =
|
|
17
|
+
let { children, fileList = {}, jsonList = {}, parsnipBasePath = "/pineapple" }
|
|
18
|
+
: {
|
|
19
|
+
children: Snippet,
|
|
20
|
+
fileList?: Record<string, () => Promise<unknown>>,
|
|
21
|
+
jsonList?: Record<string, unknown>,
|
|
22
|
+
parsnipBasePath?: string
|
|
23
|
+
} = $props();
|
|
14
24
|
|
|
15
25
|
// https://github.com/sveltejs/kit/issues/1540#issuecomment-2029016082
|
|
16
26
|
const meta: PinyaHead = ({
|
|
@@ -31,6 +41,22 @@
|
|
|
31
41
|
|
|
32
42
|
return img;
|
|
33
43
|
}) ?? []);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
let fileBasedList = $state<PageMeta[]>([]);
|
|
47
|
+
setSiteLayout(fileBasedList);
|
|
48
|
+
|
|
49
|
+
onMount(() => {
|
|
50
|
+
getParsnipDataRemote().then(data => {
|
|
51
|
+
fileBasedList.push(...parsePageMetaNested({
|
|
52
|
+
fileList,
|
|
53
|
+
jsonList,
|
|
54
|
+
imageMap: new Map<string, string>(),
|
|
55
|
+
parsnipOverall: data.parsnipOverall,
|
|
56
|
+
parsnipBasePath
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
});
|
|
34
60
|
</script>
|
|
35
61
|
|
|
36
62
|
<PineappleBaseContext>
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import "../../../styles/global.css";
|
|
2
2
|
import "../../../styles/app.css";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { type Snippet } from "svelte";
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
children: Snippet;
|
|
6
|
+
fileList?: Record<string, () => Promise<unknown>>;
|
|
7
|
+
jsonList?: Record<string, unknown>;
|
|
8
|
+
parsnipBasePath?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const PinyaBase: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
11
|
type PinyaBase = ReturnType<typeof PinyaBase>;
|
|
7
12
|
export default PinyaBase;
|
|
8
13
|
//# sourceMappingURL=PinyaBase.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinyaBase.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/pinya-base/PinyaBase.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PinyaBase.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/pinya-base/PinyaBase.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,wBAAwB,CAAC;AAMhC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAI9C,KAAK,gBAAgB,GAAI;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC;AAoGH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const menuPageServerLoadRemote =
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default MenuPageServerLoadRemote;
|
|
2
|
+
type MenuPageServerLoadRemote = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const MenuPageServerLoadRemote: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=menuPageServerLoadRemote.remote.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuPageServerLoadRemote.remote.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/templates/pinya-base/menuPageServerLoadRemote.remote.svelte.js"],"names":[],"mappings":";;;;;;;;AAeA;;;;mBAAoI;6CATvF,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,eAAe,QAAQ,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { enableUniversalOverlaySvelte4 } from "../..";
|
|
3
3
|
import {
|
|
4
|
-
getIgnoreOverlayOverride,
|
|
5
4
|
setEnableDialogOverlayContext,
|
|
6
5
|
setEnableDialogPreferenceContext,
|
|
7
6
|
setEnablePortraitContext,
|
|
@@ -10,7 +9,6 @@
|
|
|
10
9
|
} from "./pineappleBaseContextDefinitions.svelte";
|
|
11
10
|
import { createLocalStore } from "../localStore.svelte";
|
|
12
11
|
import { onMount } from "svelte";
|
|
13
|
-
import { writable } from "svelte/store";
|
|
14
12
|
|
|
15
13
|
let { children } = $props();
|
|
16
14
|
|
|
@@ -35,19 +33,19 @@
|
|
|
35
33
|
const enableDialogPrefStore = createLocalStore("enable-dialog-preference");
|
|
36
34
|
setEnableDialogPreferenceContext(enableDialogPrefStore);
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
setEnableDialogOverlayContext(
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
let enableDialog = $state({ value: enableDialogPrefStore.value });
|
|
37
|
+
setEnableDialogOverlayContext(enableDialog);
|
|
38
|
+
let ignoreOverlaySet = $state({ value: true });
|
|
39
|
+
setIgnoreOverlayOverride(ignoreOverlaySet);
|
|
42
40
|
onMount(() => {
|
|
43
41
|
enableUniversalOverlaySvelte4.subscribe((value) => {
|
|
44
|
-
if (ignoreOverlaySet) {
|
|
45
|
-
ignoreOverlaySet = false;
|
|
42
|
+
if (ignoreOverlaySet.value) {
|
|
43
|
+
ignoreOverlaySet.value = false;
|
|
46
44
|
// force initial value?
|
|
47
|
-
enableUniversalOverlaySvelte4.set(
|
|
48
|
-
|
|
45
|
+
enableUniversalOverlaySvelte4.set(enableDialogPrefStore.value);
|
|
46
|
+
enableDialog.value = enableDialogPrefStore.value;
|
|
49
47
|
} else {
|
|
50
|
-
|
|
48
|
+
enableDialog.value = value;
|
|
51
49
|
}
|
|
52
50
|
});
|
|
53
51
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PineappleBaseContext.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/util/context/PineappleBaseContext.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PineappleBaseContext.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/util/context/PineappleBaseContext.svelte.ts"],"names":[],"mappings":"AAmEA,QAAA,MAAM,oBAAoB;cAjD8B,GAAG;UAiDO,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type OverlayType, type PageMeta } from "../..";
|
|
2
2
|
import { type LocalStore } from "../localStore.svelte";
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
export declare const getEnablePortraitContext: () => LocalStore<boolean>, setEnablePortraitContext: (context: LocalStore<boolean>) => LocalStore<boolean>;
|
|
4
|
+
export declare const getEnableDialogPreferenceContext: () => LocalStore<boolean>, setEnableDialogPreferenceContext: (context: LocalStore<boolean>) => LocalStore<boolean>;
|
|
5
|
+
export declare const getEnableDialogOverlayContext: () => {
|
|
6
|
+
value: boolean;
|
|
7
|
+
}, setEnableDialogOverlayContext: (context: {
|
|
8
|
+
value: boolean;
|
|
9
|
+
}) => {
|
|
10
|
+
value: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const getOverlayTypeContext: () => LocalStore<OverlayType>, setOverlayTypeContext: (context: LocalStore<OverlayType>) => LocalStore<OverlayType>;
|
|
13
|
+
export declare const getIgnoreOverlayOverride: () => {
|
|
14
|
+
value: boolean;
|
|
15
|
+
}, setIgnoreOverlayOverride: (context: {
|
|
16
|
+
value: boolean;
|
|
17
|
+
}) => {
|
|
18
|
+
value: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const getSiteLayout: () => PageMeta[], setSiteLayout: (context: PageMeta[]) => PageMeta[];
|
|
21
|
+
/**
|
|
22
|
+
* useful for on-start dialog appearance
|
|
23
|
+
*
|
|
24
|
+
* use on onMount
|
|
25
|
+
*
|
|
26
|
+
* @param value
|
|
27
|
+
*/
|
|
28
|
+
export declare const forceSetDialog: (value: boolean) => void;
|
|
16
29
|
//# sourceMappingURL=pineappleBaseContextDefinitions.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pineappleBaseContextDefinitions.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/util/context/pineappleBaseContextDefinitions.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"pineappleBaseContextDefinitions.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/util/context/pineappleBaseContextDefinitions.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG9D,eAAO,MAAO,wBAAwB,6BAAE,wBAAwB,uDAAwC,CAAC;AACzG,eAAO,MAAO,gCAAgC,6BAAE,gCAAgC,uDAAwC,CAAC;AAIzH,eAAO,MAAO,6BAA6B;WAAyD,OAAO;GAA9D,6BAA6B;WAA0B,OAAO;;WAAP,OAAO;CAAI,CAAC;AAEhH,eAAO,MAAO,qBAAqB,iCAAE,qBAAqB,+DAA4C,CAAC;AACvG,eAAO,MAAO,wBAAwB;WAAqD,OAAO;GAA1D,wBAAwB;WAA2B,OAAO;;WAAP,OAAO;CAAK,CAAC;AACxG,eAAO,MAAO,aAAa,oBAAE,aAAa,qCAA+B,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,SAI5C,CAAA"}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
overlayTypeContext = value;
|
|
24
|
-
};
|
|
25
|
-
export const getIgnoreOverlayOverride = () => ignoreOverlayOverride;
|
|
26
|
-
export const setIgnoreOverlayOverride = (value) => {
|
|
27
|
-
ignoreOverlayOverride = value;
|
|
28
|
-
};
|
|
29
|
-
export const getSiteLayout = () => siteLayout;
|
|
30
|
-
export const setSiteLayout = (value) => {
|
|
31
|
-
siteLayout = value;
|
|
1
|
+
import { enableUniversalOverlaySvelte4 } from "../..";
|
|
2
|
+
import {} from "../localStore.svelte";
|
|
3
|
+
import { createContext } from "svelte";
|
|
4
|
+
export const [getEnablePortraitContext, setEnablePortraitContext] = createContext();
|
|
5
|
+
export const [getEnableDialogPreferenceContext, setEnableDialogPreferenceContext] = createContext();
|
|
6
|
+
// note to self: proper two way binding is seen with the variables below
|
|
7
|
+
// see https://svelte.dev/docs/svelte/context#Using-context-with-state
|
|
8
|
+
export const [getEnableDialogOverlayContext, setEnableDialogOverlayContext] = createContext();
|
|
9
|
+
export const [getOverlayTypeContext, setOverlayTypeContext] = createContext();
|
|
10
|
+
export const [getIgnoreOverlayOverride, setIgnoreOverlayOverride] = createContext();
|
|
11
|
+
export const [getSiteLayout, setSiteLayout] = createContext();
|
|
12
|
+
/**
|
|
13
|
+
* useful for on-start dialog appearance
|
|
14
|
+
*
|
|
15
|
+
* use on onMount
|
|
16
|
+
*
|
|
17
|
+
* @param value
|
|
18
|
+
*/
|
|
19
|
+
export const forceSetDialog = (value) => {
|
|
20
|
+
const ignoreOverride = getIgnoreOverlayOverride();
|
|
21
|
+
ignoreOverride.value = false;
|
|
22
|
+
enableUniversalOverlaySvelte4.set(value);
|
|
32
23
|
};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { OverlayType } from "..";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export declare class LocalStore<T> {
|
|
3
|
+
value: T;
|
|
4
|
+
key: string;
|
|
5
|
+
valueType: "undefined" | "object" | "boolean" | "number" | "string" | "function" | "symbol" | "bigint";
|
|
6
|
+
defaultValue: T;
|
|
7
|
+
constructor(key: string, defaultValue: T);
|
|
8
|
+
serialize(value: T): string;
|
|
9
|
+
deserialize(item: string): T;
|
|
10
|
+
}
|
|
4
11
|
export interface LocalStoreRestriction {
|
|
5
12
|
"enable-portrait": boolean;
|
|
6
13
|
"enable-dialog-preference": boolean;
|
|
7
14
|
"overlay-type": OverlayType;
|
|
8
15
|
}
|
|
9
|
-
export declare const createLocalStore: <k extends keyof LocalStoreRestriction>(key: k) =>
|
|
16
|
+
export declare const createLocalStore: <k extends keyof LocalStoreRestriction>(key: k) => LocalStore<Readonly<LocalStoreRestriction>[k]>;
|
|
10
17
|
//# sourceMappingURL=localStore.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localStore.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/util/localStore.svelte.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"localStore.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/util/localStore.svelte.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAOxC,qBAAa,UAAU,CAAC,CAAC;IACxB,KAAK,EAAkB,CAAC,CAAC;IACzB,GAAG,SAAM;IACT,SAAS,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACvG,YAAY,EAAE,CAAC,CAAC;gBAEJ,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAmCxC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM;IAQ3B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC;CAc5B;AAED,MAAM,WAAW,qBAAqB;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0BAA0B,EAAE,OAAO,CAAC;IACpC,cAAc,EAAE,WAAW,CAAC;CAC5B;AAQD,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,MAAM,qBAAqB,EAAE,KAAK,CAAC,mDAE7E,CAAC"}
|
|
@@ -1,27 +1,51 @@
|
|
|
1
1
|
/** from https://www.reddit.com/r/sveltejs/comments/1d43d8p/svelte_5_runes_with_localstorage_thanks_to_joy_of/ */
|
|
2
2
|
import { browser } from "$app/environment";
|
|
3
|
-
import { writable } from "svelte/store";
|
|
4
3
|
// const localConsole = console;
|
|
5
4
|
const localConsole = undefined;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
export class LocalStore {
|
|
6
|
+
constructor(key, defaultValue) {
|
|
7
|
+
this.value = $state();
|
|
8
|
+
this.key = "";
|
|
9
|
+
this.key = key;
|
|
10
|
+
this.defaultValue = defaultValue;
|
|
11
|
+
this.value = defaultValue;
|
|
12
|
+
this.valueType = typeof defaultValue;
|
|
13
|
+
let localStorageState = $state('initial');
|
|
14
|
+
if (browser) {
|
|
15
|
+
const item = localStorage.getItem(`pinya-local-${key}`);
|
|
16
|
+
if (item) {
|
|
17
|
+
this.value = this.deserialize(item);
|
|
18
|
+
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`initializing initial ${this.key}: ${this.value}`);
|
|
19
|
+
}
|
|
20
|
+
localStorageState = 'accessed';
|
|
21
|
+
}
|
|
22
|
+
$effect(() => {
|
|
23
|
+
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`updating ${this.key}: ${this.value}`);
|
|
24
|
+
switch (localStorageState) {
|
|
25
|
+
case "initial":
|
|
26
|
+
// completely ignore all next changes
|
|
27
|
+
break;
|
|
28
|
+
case "accessed":
|
|
29
|
+
// for the initial change, we ignore it but allow the next changes to be writable
|
|
30
|
+
localStorageState = 'writable';
|
|
31
|
+
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`setting writable for ${this.key}`);
|
|
32
|
+
break;
|
|
33
|
+
case "writable":
|
|
34
|
+
localStorage.setItem(`pinya-local-${this.key}`, this.serialize(this.value));
|
|
35
|
+
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`initializing after ${this.key}: ${this.value}`);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
serialize(value) {
|
|
41
|
+
if (this.valueType !== "object") {
|
|
42
|
+
return value;
|
|
19
43
|
}
|
|
20
44
|
return JSON.stringify(value);
|
|
21
|
-
}
|
|
22
|
-
|
|
45
|
+
}
|
|
46
|
+
deserialize(item) {
|
|
23
47
|
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`deserializing item ${item}`);
|
|
24
|
-
if (valueType === "string") {
|
|
48
|
+
if (this.valueType === "string") {
|
|
25
49
|
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`deserializing string ${item}`);
|
|
26
50
|
return item;
|
|
27
51
|
}
|
|
@@ -30,27 +54,21 @@ export const createLocalStore = (key) => {
|
|
|
30
54
|
}
|
|
31
55
|
catch (error) {
|
|
32
56
|
console.error(error);
|
|
33
|
-
return defaultValue;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
if (browser) {
|
|
37
|
-
const item = localStorage.getItem(storageKey);
|
|
38
|
-
if (item) {
|
|
39
|
-
store.set(deserialize(item));
|
|
40
|
-
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`initializing initial ${storageKey}: ${item}`);
|
|
57
|
+
return this.defaultValue;
|
|
41
58
|
}
|
|
42
59
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
localStorage.setItem(storageKey, serialize(value));
|
|
53
|
-
localConsole === null || localConsole === void 0 ? void 0 : localConsole.log(`initializing after ${storageKey}: ${value}`);
|
|
54
|
-
});
|
|
55
|
-
return store;
|
|
60
|
+
}
|
|
61
|
+
const localStoreDefault = {
|
|
62
|
+
"enable-portrait": true,
|
|
63
|
+
"enable-dialog-preference": true,
|
|
64
|
+
"overlay-type": 'dialog',
|
|
65
|
+
};
|
|
66
|
+
export const createLocalStore = (key) => {
|
|
67
|
+
return new LocalStore(key, localStoreDefault[key]);
|
|
56
68
|
};
|
|
69
|
+
// export const createAllLocalStore = () => {
|
|
70
|
+
// let enablePortrait = $state(createLocalStore('enablePortrait'));
|
|
71
|
+
// return {
|
|
72
|
+
// enablePortrait
|
|
73
|
+
// }
|
|
74
|
+
// }
|
package/package.json
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnipxenon/pineapple",
|
|
3
3
|
"description": "personal package for base styling for other personal projects",
|
|
4
|
-
"version": "5.0.0-alpha.
|
|
4
|
+
"version": "5.0.0-alpha.12",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@commitlint/cli": "^19.8.1",
|
|
7
7
|
"@commitlint/config-conventional": "^19.8.1",
|
|
8
8
|
"@eslint/compat": "^1.4.1",
|
|
9
9
|
"@eslint/js": "^9.39.2",
|
|
10
|
+
"@inlang/paraglide-js": "~2.4.0",
|
|
11
|
+
"@prisma/client": "^5.22.0",
|
|
12
|
+
"@shikijs/transformers": "^3.22.0",
|
|
10
13
|
"@sveltejs/adapter-cloudflare": "^7.2.6",
|
|
14
|
+
"@sveltejs/kit": "2.49.5",
|
|
11
15
|
"@sveltejs/package": "^2.5.7",
|
|
16
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
12
17
|
"@types/htmlparser2": "^3.10.7",
|
|
13
18
|
"@types/mdast": "^4.0.4",
|
|
14
|
-
"@types/node": "^20.19.
|
|
19
|
+
"@types/node": "^20.19.31",
|
|
15
20
|
"eslint": "^9.39.2",
|
|
16
21
|
"eslint-config-prettier": "^10.1.8",
|
|
17
22
|
"eslint-plugin-svelte": "^3.14.0",
|
|
@@ -29,19 +34,15 @@
|
|
|
29
34
|
"publint": "^0.2.12",
|
|
30
35
|
"sass": "^1.97.3",
|
|
31
36
|
"string-width": "^7.2.0",
|
|
32
|
-
"svelte": "^5.49.
|
|
37
|
+
"svelte": "^5.49.2",
|
|
33
38
|
"svelte-check": "^4.3.6",
|
|
34
39
|
"svelte2tsx": "^0.7.47",
|
|
35
40
|
"ts-node": "^10.9.2",
|
|
36
41
|
"tslib": "^2.8.1",
|
|
37
42
|
"typescript": "^5.9.3",
|
|
38
43
|
"typescript-eslint": "^8.54.0",
|
|
39
|
-
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
40
44
|
"vite": "^7.3.1",
|
|
41
|
-
"wrangler": "4.59.1"
|
|
42
|
-
"@sveltejs/kit": "2.49.5",
|
|
43
|
-
"@inlang/paraglide-js": "~2.4.0",
|
|
44
|
-
"@prisma/client": "^5.22.0"
|
|
45
|
+
"wrangler": "4.59.1"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"melt": "^0.44.0",
|
|
@@ -87,6 +88,8 @@
|
|
|
87
88
|
},
|
|
88
89
|
"files": [
|
|
89
90
|
"dist",
|
|
91
|
+
"!dist/**/*.test.*",
|
|
92
|
+
"!dist/**/*.spec.*",
|
|
90
93
|
"src/lib/styles/app.css",
|
|
91
94
|
"src/lib/theme.css"
|
|
92
95
|
],
|
package/src/lib/styles/app.css
CHANGED
|
@@ -76,88 +76,6 @@ a.external-link {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/*https://shiki.style/guide/dual-themes*/
|
|
80
|
-
html.dark .shiki,
|
|
81
|
-
html.dark .shiki span {
|
|
82
|
-
color: var(--shiki-dark) !important;
|
|
83
|
-
background-color: var(--shiki-dark-bg) !important;
|
|
84
|
-
/* Optional, if you also want font styles */
|
|
85
|
-
font-style: var(--shiki-dark-font-style) !important;
|
|
86
|
-
font-weight: var(--shiki-dark-font-weight) !important;
|
|
87
|
-
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.inline-code {
|
|
91
|
-
background-color: aliceblue;
|
|
92
|
-
padding: 0.2rem;
|
|
93
|
-
border-radius: 0.2rem;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
html.dark .inline-code {
|
|
97
|
-
background-color: #303446;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.shiki {
|
|
101
|
-
span {
|
|
102
|
-
white-space: pre-wrap;
|
|
103
|
-
word-wrap: break-word;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* region shiki copy button */
|
|
108
|
-
pre:has(code) {
|
|
109
|
-
position: relative;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
pre button.copy {
|
|
113
|
-
position: absolute;
|
|
114
|
-
right: 16px;
|
|
115
|
-
top: 16px;
|
|
116
|
-
height: 28px;
|
|
117
|
-
width: 28px;
|
|
118
|
-
padding: 0;
|
|
119
|
-
display: flex;
|
|
120
|
-
|
|
121
|
-
& span {
|
|
122
|
-
width: 100%;
|
|
123
|
-
aspect-ratio: 1 / 1;
|
|
124
|
-
background-repeat: no-repeat;
|
|
125
|
-
background-position: center;
|
|
126
|
-
background-size: cover;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
& .ready {
|
|
130
|
-
background-image: url("$pkg/assets/icons/icon-copy-light-contrast.svg");
|
|
131
|
-
/*todo*/
|
|
132
|
-
/*@variant dark {*/
|
|
133
|
-
/* background-image: url("$pkg/assets/icons/icon-copy-dark-contrast.svg");*/
|
|
134
|
-
/*}*/
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
& .success {
|
|
138
|
-
display: none;
|
|
139
|
-
background-image: url("$pkg/assets/icons/icon-check-light-contrast.svg");
|
|
140
|
-
|
|
141
|
-
/*todo: migration*/
|
|
142
|
-
/*@variant dark {*/
|
|
143
|
-
/* background-image: url("$pkg/assets/icons/icon-check-dark-contrast.svg");*/
|
|
144
|
-
/*}*/
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&.copied {
|
|
148
|
-
& .success {
|
|
149
|
-
display: block;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
& .ready {
|
|
153
|
-
display: none;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/* endregion shiki copy button */
|
|
159
|
-
|
|
160
|
-
|
|
161
79
|
ul + h2, ol + h2 {
|
|
162
80
|
margin-top: 1rlh;
|
|
163
81
|
}
|