rimelight-components 2.1.82 → 2.1.84

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/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimelight-components",
3
- "version": "2.1.82",
3
+ "version": "2.1.84",
4
4
  "docs": "https://rimelight.com/tools/rimelight-components",
5
5
  "configKey": "rimelightComponents",
6
6
  "compatibility": {
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import { readdirSync } from 'node:fs';
4
4
  import { basename } from 'node:path';
5
5
 
6
6
  const name = "rimelight-components";
7
- const version = "2.1.82";
7
+ const version = "2.1.84";
8
8
  const homepage = "https://rimelight.com/tools/rimelight-components";
9
9
 
10
10
  const defaultOptions = {
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import { ref, computed, useTemplateRef, provide } from "vue";
3
3
  import {} from "../../types";
4
- import { usePageEditor, usePageRegistry, useRC } from "../../composables";
4
+ import { usePageEditor, usePageRegistry, useRC, useHeaderStack } from "../../composables";
5
5
  import { getLocalizedContent } from "../../utils";
6
6
  import { useI18n } from "vue-i18n";
7
7
  import { tv } from "../../internal/tv";
@@ -44,7 +44,7 @@ const pageEditorStyles = tv({
44
44
  slots: {
45
45
  header: "h-12 w-full bg-muted",
46
46
  headerGroup: "flex items-center gap-xs",
47
- splitContainer: "flex w-full overflow-hidden",
47
+ splitContainer: "flex w-full overflow-hidden min-h-0",
48
48
  editorColumn: "h-full overflow-y-auto",
49
49
  container: "flex flex-col py-16",
50
50
  grid: "grid grid-cols-1 lg:grid-cols-24 gap-xl items-start",
@@ -99,6 +99,7 @@ provide("page-resolver", resolvePage);
99
99
  const previousPage = computed(() => surround?.previous);
100
100
  const nextPage = computed(() => surround?.next);
101
101
  const hasSurround = computed(() => !!(surround?.previous || surround?.next));
102
+ const { totalHeight } = useHeaderStack();
102
103
  const containerRef = useTemplateRef("split-container");
103
104
  const editorWidth = ref(50);
104
105
  const isResizing = ref(false);
@@ -285,7 +286,11 @@ const handleTreeNavigate = (slug) => {
285
286
  </UHeader>
286
287
  </RCHeaderLayer>
287
288
 
288
- <div ref="split-container" :class="splitContainer({ class: rc.splitContainer })">
289
+ <div
290
+ ref="split-container"
291
+ :class="splitContainer({ class: rc.splitContainer })"
292
+ :style="{ height: `calc(100vh - ${totalHeight}px)` }"
293
+ >
289
294
  <div
290
295
  :class="editorColumn({ class: rc.editorColumn })"
291
296
  :style="{ width: showPreview ? `${editorWidth}%` : '100%' }"
@@ -0,0 +1,19 @@
1
+ export interface ColorPaletteProps {
2
+ /**
3
+ * Raw CSS content to parse
4
+ */
5
+ css?: string;
6
+ /**
7
+ * UI custom classes
8
+ */
9
+ rc?: {
10
+ root?: string;
11
+ section?: string;
12
+ title?: string;
13
+ grid?: string;
14
+ swatch?: string;
15
+ };
16
+ }
17
+ declare const __VLS_export: import("vue").DefineComponent<ColorPaletteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorPaletteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -0,0 +1,96 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import ColorSwatch from "./ColorSwatch.vue";
4
+ import { tv } from "../../internal/tv";
5
+ import { useRC } from "../../composables";
6
+ const { css = "", rc: rcProp } = defineProps({
7
+ css: { type: String, required: false },
8
+ rc: { type: Object, required: false }
9
+ });
10
+ const { rc } = useRC("ColorPalette", rcProp);
11
+ const paletteStyles = tv({
12
+ slots: {
13
+ root: "flex flex-col gap-12",
14
+ section: "flex flex-col gap-6",
15
+ title: "",
16
+ grid: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"
17
+ }
18
+ });
19
+ const { root, section: sectionStyle, title: titleStyle, grid } = paletteStyles();
20
+ const sections = computed(() => {
21
+ if (!css) return [];
22
+ const result = [];
23
+ const lines = css.split("\n");
24
+ const stack = [];
25
+ function getFormat(value) {
26
+ if (value.startsWith("#")) return "hex";
27
+ if (value.startsWith("oklch")) return "oklch";
28
+ if (value.startsWith("rgb")) return "rgb";
29
+ if (value.startsWith("hsl")) return "hsl";
30
+ if (value.startsWith("cmyk")) return "cmyk";
31
+ return "unknown";
32
+ }
33
+ function getName(fullVarName) {
34
+ const parts = fullVarName.split("-");
35
+ return parts[parts.length - 1] ?? "";
36
+ }
37
+ lines.forEach((line) => {
38
+ const regionStartMatch = line.match(/\/\*\s*region\s+(.*?)\s*\*\//);
39
+ const regionEndMatch = line.match(/\/\*\s*endregion\s*\*\//);
40
+ if (regionStartMatch) {
41
+ stack.push(regionStartMatch[1] ?? "");
42
+ }
43
+ const colorMatch = line.match(/^\s*--color-([\w-]+):\s*(.*?);/);
44
+ if (colorMatch && !line.trim().startsWith("/*")) {
45
+ const fullVarName = colorMatch[1] ?? "";
46
+ const value = colorMatch[2]?.trim() ?? "";
47
+ const title = stack.length > 0 ? stack.join(" \u203A ") : "Other";
48
+ let section = result.find((s) => s.title === title);
49
+ if (!section) {
50
+ section = { title, swatches: [] };
51
+ result.push(section);
52
+ }
53
+ section.swatches.push({
54
+ name: getName(fullVarName),
55
+ value,
56
+ format: getFormat(value)
57
+ });
58
+ }
59
+ if (regionEndMatch) {
60
+ stack.pop();
61
+ }
62
+ });
63
+ return result;
64
+ });
65
+ function getSwatchProps(swatch) {
66
+ const p = { name: swatch.name };
67
+ if (swatch.format !== "unknown") {
68
+ p[swatch.format] = swatch.value;
69
+ } else {
70
+ p.oklch = swatch.value;
71
+ }
72
+ return p;
73
+ }
74
+ </script>
75
+
76
+ <template>
77
+ <div :class="root({ class: rc.root })">
78
+ <section
79
+ v-for="section in sections"
80
+ :key="section.title"
81
+ :class="sectionStyle({ class: rc.section })"
82
+ >
83
+ <h2 :class="titleStyle({ class: ['text-3xl font-bold text-highlighted', rc.title] })">
84
+ {{ section.title }}
85
+ </h2>
86
+ <div :class="grid({ class: rc.grid })">
87
+ <ColorSwatch
88
+ v-for="swatch in section.swatches"
89
+ :key="swatch.name"
90
+ v-bind="getSwatchProps(swatch)"
91
+ :class="rc.swatch"
92
+ />
93
+ </div>
94
+ </section>
95
+ </div>
96
+ </template>
@@ -0,0 +1,19 @@
1
+ export interface ColorPaletteProps {
2
+ /**
3
+ * Raw CSS content to parse
4
+ */
5
+ css?: string;
6
+ /**
7
+ * UI custom classes
8
+ */
9
+ rc?: {
10
+ root?: string;
11
+ section?: string;
12
+ title?: string;
13
+ grid?: string;
14
+ swatch?: string;
15
+ };
16
+ }
17
+ declare const __VLS_export: import("vue").DefineComponent<ColorPaletteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorPaletteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -1,3 +1,4 @@
1
1
  export { default as ColorSwatch } from './ColorSwatch.vue.js';
2
+ export { default as ColorPalette } from './ColorPalette.vue.js';
2
3
  export { default as FontSwatch } from './FontSwatch.vue.js';
3
4
  export { default as ImageSwatch } from './ImageSwatch.vue.js';
@@ -1,3 +1,4 @@
1
1
  export { default as ColorSwatch } from "./ColorSwatch.vue";
2
+ export { default as ColorPalette } from "./ColorPalette.vue";
2
3
  export { default as FontSwatch } from "./FontSwatch.vue";
3
4
  export { default as ImageSwatch } from "./ImageSwatch.vue";
@@ -1,3 +1,4 @@
1
1
  export { default as ColorSwatch } from "./ColorSwatch.vue";
2
+ export { default as ColorPalette } from "./ColorPalette.vue";
2
3
  export { default as FontSwatch } from "./FontSwatch.vue";
3
4
  export { default as ImageSwatch } from "./ImageSwatch.vue";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimelight-components",
3
- "version": "2.1.82",
3
+ "version": "2.1.84",
4
4
  "description": "A component library by Rimelight Entertainment.",
5
5
  "keywords": [
6
6
  "nuxt",
@@ -70,9 +70,10 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@nuxt/kit": "^4.3.0",
73
+ "chroma-js": "^3.2.0",
73
74
  "defu": "^6.1.4",
74
- "tailwind-variants": "^3.2.2",
75
75
  "tailwind-merge": "^3.4.0",
76
+ "tailwind-variants": "^3.2.2",
76
77
  "uuid": "^13.0.0"
77
78
  },
78
79
  "devDependencies": {