@owdproject/nuxt-theme-paper 0.0.0-stage → 4.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +62 -2
- package/dist/module.d.mts +7 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +55 -0
- package/dist/runtime/assets/styles/index.css +533 -0
- package/dist/runtime/assets/styles/partials/checkbox.css +158 -0
- package/dist/runtime/assets/styles/partials/contextmenu.css +22 -0
- package/dist/runtime/assets/styles/partials/desktop.css +69 -0
- package/dist/runtime/assets/styles/partials/input.css +155 -0
- package/dist/runtime/assets/styles/partials/menu.css +72 -0
- package/dist/runtime/assets/styles/partials/scrollbar.css +25 -0
- package/dist/runtime/assets/styles/partials/tabs.css +163 -0
- package/dist/runtime/assets/styles/partials/window-chrome.css +45 -0
- package/dist/runtime/assets/styles/partials/window.css +30 -0
- package/dist/runtime/components/ButtonWindowNav.d.vue.ts +17 -0
- package/dist/runtime/components/ButtonWindowNav.vue +12 -0
- package/dist/runtime/components/ButtonWindowNav.vue.d.ts +17 -0
- package/dist/runtime/components/Desktop.d.vue.ts +13 -0
- package/dist/runtime/components/Desktop.vue +21 -0
- package/dist/runtime/components/Desktop.vue.d.ts +13 -0
- package/dist/runtime/components/DesktopContent.d.vue.ts +13 -0
- package/dist/runtime/components/DesktopContent.vue +9 -0
- package/dist/runtime/components/DesktopContent.vue.d.ts +13 -0
- package/dist/runtime/components/DesktopWindow.d.vue.ts +21 -0
- package/dist/runtime/components/DesktopWindow.vue +51 -0
- package/dist/runtime/components/DesktopWindow.vue.d.ts +21 -0
- package/dist/runtime/components/DesktopWindowContent.d.vue.ts +13 -0
- package/dist/runtime/components/DesktopWindowContent.vue +31 -0
- package/dist/runtime/components/DesktopWindowContent.vue.d.ts +13 -0
- package/dist/runtime/components/DesktopWindowIframe.d.vue.ts +20 -0
- package/dist/runtime/components/DesktopWindowIframe.vue +30 -0
- package/dist/runtime/components/DesktopWindowIframe.vue.d.ts +20 -0
- package/dist/runtime/components/DesktopWindowNav.d.vue.ts +15 -0
- package/dist/runtime/components/DesktopWindowNav.vue +113 -0
- package/dist/runtime/components/DesktopWindowNav.vue.d.ts +15 -0
- package/dist/runtime/components/DesktopWindowNavButton.d.vue.ts +17 -0
- package/dist/runtime/components/DesktopWindowNavButton.vue +54 -0
- package/dist/runtime/components/DesktopWindowNavButton.vue.d.ts +17 -0
- package/dist/runtime/components/PaperSystemBar.d.vue.ts +3 -0
- package/dist/runtime/components/PaperSystemBar.vue +808 -0
- package/dist/runtime/components/PaperSystemBar.vue.d.ts +3 -0
- package/dist/runtime/components/PaperWindowSnapHints.d.vue.ts +3 -0
- package/dist/runtime/components/PaperWindowSnapHints.vue +7 -0
- package/dist/runtime/components/PaperWindowSnapHints.vue.d.ts +3 -0
- package/dist/runtime/composables/usePaperAppearance.d.ts +8 -0
- package/dist/runtime/composables/usePaperAppearance.js +18 -0
- package/dist/runtime/plugins/paper-appearance.client.d.ts +6 -0
- package/dist/runtime/plugins/paper-appearance.client.js +16 -0
- package/dist/runtime/utils/paperAppearance.d.ts +10 -0
- package/dist/runtime/utils/paperAppearance.js +18 -0
- package/dist/types.d.mts +7 -0
- package/package.json +61 -4
- package/src/module.ts +71 -0
- package/src/runtime/assets/styles/index.scss +13 -0
- package/src/runtime/assets/styles/partials/_variables.scss +111 -0
- package/src/runtime/assets/styles/partials/checkbox.scss +64 -0
- package/src/runtime/assets/styles/partials/contextmenu.scss +25 -0
- package/src/runtime/assets/styles/partials/desktop.scss +70 -0
- package/src/runtime/assets/styles/partials/input.scss +55 -0
- package/src/runtime/assets/styles/partials/menu.scss +88 -0
- package/src/runtime/assets/styles/partials/scrollbar.scss +35 -0
- package/src/runtime/assets/styles/partials/tabs.scss +68 -0
- package/src/runtime/assets/styles/partials/window-chrome.scss +57 -0
- package/src/runtime/assets/styles/partials/window.scss +32 -0
- package/src/runtime/components/ButtonWindowNav.vue +12 -0
- package/src/runtime/components/Desktop.vue +22 -0
- package/src/runtime/components/DesktopContent.vue +14 -0
- package/src/runtime/components/DesktopWindow.vue +76 -0
- package/src/runtime/components/DesktopWindowContent.vue +31 -0
- package/src/runtime/components/DesktopWindowIframe.vue +30 -0
- package/src/runtime/components/DesktopWindowNav.vue +115 -0
- package/src/runtime/components/DesktopWindowNavButton.vue +55 -0
- package/src/runtime/components/PaperSystemBar.vue +1482 -0
- package/src/runtime/components/PaperWindowSnapHints.vue +7 -0
- package/src/runtime/composables/usePaperAppearance.ts +26 -0
- package/src/runtime/plugins/paper-appearance.client.ts +23 -0
- package/src/runtime/utils/paperAppearance.ts +31 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_PAPER_APPEARANCE,
|
|
3
|
+
paperAppearanceId,
|
|
4
|
+
type PaperAppearance,
|
|
5
|
+
} from '../utils/paperAppearance'
|
|
6
|
+
|
|
7
|
+
/** Read/write Paper light/dark appearance (theme-local, not core store). */
|
|
8
|
+
export function usePaperAppearance() {
|
|
9
|
+
function setAppearance(appearance: PaperAppearance) {
|
|
10
|
+
paperAppearanceId.value = appearance
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function toggleAppearance() {
|
|
14
|
+
paperAppearanceId.value =
|
|
15
|
+
paperAppearanceId.value === 'dark'
|
|
16
|
+
? 'light'
|
|
17
|
+
: 'dark'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
appearance: paperAppearanceId,
|
|
22
|
+
defaultAppearance: DEFAULT_PAPER_APPEARANCE,
|
|
23
|
+
setAppearance,
|
|
24
|
+
toggleAppearance,
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { watch } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_PAPER_APPEARANCE,
|
|
4
|
+
PAPER_APPEARANCE_STORAGE_KEY,
|
|
5
|
+
paperAppearanceId,
|
|
6
|
+
readPersistedAppearance,
|
|
7
|
+
syncHtmlAppearance,
|
|
8
|
+
} from '../utils/paperAppearance'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Paper light/dark: localStorage → shared ref → html[data-owd-appearance].
|
|
12
|
+
* Head bootstrap script prevents first-paint flash on reload.
|
|
13
|
+
*/
|
|
14
|
+
export default defineNuxtPlugin(() => {
|
|
15
|
+
paperAppearanceId.value =
|
|
16
|
+
readPersistedAppearance() ?? DEFAULT_PAPER_APPEARANCE
|
|
17
|
+
syncHtmlAppearance(paperAppearanceId.value)
|
|
18
|
+
|
|
19
|
+
watch(paperAppearanceId, (appearance) => {
|
|
20
|
+
localStorage.setItem(PAPER_APPEARANCE_STORAGE_KEY, appearance)
|
|
21
|
+
syncHtmlAppearance(appearance)
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
export type PaperAppearance = 'light' | 'dark'
|
|
4
|
+
|
|
5
|
+
export const PAPER_APPEARANCE_STORAGE_KEY = 'owd-paper-appearance'
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_PAPER_APPEARANCE: PaperAppearance = 'light'
|
|
8
|
+
|
|
9
|
+
/** Shared appearance state — hydrated and synced by `paper-appearance.client` plugin. */
|
|
10
|
+
export const paperAppearanceId = ref<PaperAppearance>(DEFAULT_PAPER_APPEARANCE)
|
|
11
|
+
|
|
12
|
+
export function isPaperAppearance(value: string): value is PaperAppearance {
|
|
13
|
+
return value === 'light' || value === 'dark'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function readPersistedAppearance(): PaperAppearance | undefined {
|
|
17
|
+
if (typeof localStorage === 'undefined') return undefined
|
|
18
|
+
|
|
19
|
+
const stored = localStorage.getItem(PAPER_APPEARANCE_STORAGE_KEY)
|
|
20
|
+
if (stored && isPaperAppearance(stored)) return stored
|
|
21
|
+
|
|
22
|
+
return undefined
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Inline bootstrap: set data-owd-appearance before CSS paints (no flash). */
|
|
26
|
+
export const paperAppearanceBootstrapScript = `(function(){var el=document.documentElement,d=${JSON.stringify(DEFAULT_PAPER_APPEARANCE)};try{var s=localStorage.getItem(${JSON.stringify(PAPER_APPEARANCE_STORAGE_KEY)});if(s==="light"||s==="dark"){el.dataset.owdAppearance=s;return}}catch(e){}el.dataset.owdAppearance=d})();`
|
|
27
|
+
|
|
28
|
+
export function syncHtmlAppearance(appearance: PaperAppearance) {
|
|
29
|
+
if (typeof document === 'undefined') return
|
|
30
|
+
document.documentElement.dataset.owdAppearance = appearance
|
|
31
|
+
}
|