@mission-studio/puck 1.0.17 → 1.0.19

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.
@@ -2,7 +2,7 @@ import {
2
2
  getShadowCSS,
3
3
  useEntries,
4
4
  useTheme
5
- } from "./chunk-KV2RSRAM.mjs";
5
+ } from "./chunk-PJXZC564.mjs";
6
6
  import {
7
7
  useGtmEvent,
8
8
  useUtmParams
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  cn,
12
12
  hexToRgba
13
- } from "./chunk-D3L26TIT.mjs";
13
+ } from "./chunk-C6V3YUPF.mjs";
14
14
 
15
15
  // components/page/Heading.tsx
16
16
  import { jsx } from "react/jsx-runtime";
@@ -50,6 +50,20 @@ function isValidHex(color) {
50
50
  return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
51
51
  }
52
52
  function hexToRgba(hex, opacity) {
53
+ if (hex.startsWith("rgba(")) {
54
+ const rgbaMatch = hex.match(
55
+ /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/
56
+ );
57
+ if (rgbaMatch) {
58
+ return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity / 100})`;
59
+ }
60
+ }
61
+ if (hex.startsWith("rgb(")) {
62
+ const rgbMatch = hex.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
63
+ if (rgbMatch) {
64
+ return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${opacity / 100})`;
65
+ }
66
+ }
53
67
  const sanitized = hex.replace("#", "");
54
68
  const r = parseInt(sanitized.slice(0, 2), 16);
55
69
  const g = parseInt(sanitized.slice(2, 4), 16);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_THEME
3
- } from "./chunk-D3L26TIT.mjs";
3
+ } from "./chunk-C6V3YUPF.mjs";
4
4
 
5
5
  // entries/context.tsx
6
6
  import { createContext, useContext } from "react";
@@ -12,13 +12,13 @@ import {
12
12
  shadowPresets,
13
13
  useEntries,
14
14
  useTheme
15
- } from "./chunk-KV2RSRAM.mjs";
15
+ } from "./chunk-PJXZC564.mjs";
16
16
  import {
17
17
  cn,
18
18
  hexToRgba,
19
19
  isValidHex,
20
20
  normalizeHex
21
- } from "./chunk-D3L26TIT.mjs";
21
+ } from "./chunk-C6V3YUPF.mjs";
22
22
 
23
23
  // fields/BorderRadiusField.tsx
24
24
  import { useState } from "react";
@@ -110,6 +110,20 @@ function useTheme() {
110
110
  var import_tailwind_merge = require("tailwind-merge");
111
111
  var import_clsx = require("clsx");
112
112
  function hexToRgba(hex, opacity) {
113
+ if (hex.startsWith("rgba(")) {
114
+ const rgbaMatch = hex.match(
115
+ /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/
116
+ );
117
+ if (rgbaMatch) {
118
+ return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity / 100})`;
119
+ }
120
+ }
121
+ if (hex.startsWith("rgb(")) {
122
+ const rgbMatch = hex.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
123
+ if (rgbMatch) {
124
+ return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${opacity / 100})`;
125
+ }
126
+ }
113
127
  const sanitized = hex.replace("#", "");
114
128
  const r = parseInt(sanitized.slice(0, 2), 16);
115
129
  const g = parseInt(sanitized.slice(2, 4), 16);
@@ -19,10 +19,10 @@ import {
19
19
  TextBlock,
20
20
  Topbar,
21
21
  VideoEmbed
22
- } from "../chunk-ML3AS3AY.mjs";
23
- import "../chunk-KV2RSRAM.mjs";
22
+ } from "../chunk-723Z3YKC.mjs";
23
+ import "../chunk-PJXZC564.mjs";
24
24
  import "../chunk-QSWQDR6M.mjs";
25
- import "../chunk-D3L26TIT.mjs";
25
+ import "../chunk-C6V3YUPF.mjs";
26
26
 
27
27
  // config/server.tsx
28
28
  import { jsx } from "react/jsx-runtime";
@@ -123,6 +123,20 @@ function isValidHex(color) {
123
123
  return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
124
124
  }
125
125
  function hexToRgba(hex, opacity) {
126
+ if (hex.startsWith("rgba(")) {
127
+ const rgbaMatch = hex.match(
128
+ /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/
129
+ );
130
+ if (rgbaMatch) {
131
+ return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity / 100})`;
132
+ }
133
+ }
134
+ if (hex.startsWith("rgb(")) {
135
+ const rgbMatch = hex.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
136
+ if (rgbMatch) {
137
+ return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${opacity / 100})`;
138
+ }
139
+ }
126
140
  const sanitized = hex.replace("#", "");
127
141
  const r = parseInt(sanitized.slice(0, 2), 16);
128
142
  const g = parseInt(sanitized.slice(2, 4), 16);
@@ -6,7 +6,7 @@ import {
6
6
  createShadowField,
7
7
  createSpacingField,
8
8
  createThemeableColorField
9
- } from "./chunk-SYXQQITG.mjs";
9
+ } from "./chunk-VF4NOAJG.mjs";
10
10
  import "./chunk-A3QDUUOF.mjs";
11
11
  import {
12
12
  Button,
@@ -30,10 +30,10 @@ import {
30
30
  Topbar,
31
31
  VideoEmbed,
32
32
  availableIcons
33
- } from "./chunk-ML3AS3AY.mjs";
34
- import "./chunk-KV2RSRAM.mjs";
33
+ } from "./chunk-723Z3YKC.mjs";
34
+ import "./chunk-PJXZC564.mjs";
35
35
  import "./chunk-QSWQDR6M.mjs";
36
- import "./chunk-D3L26TIT.mjs";
36
+ import "./chunk-C6V3YUPF.mjs";
37
37
 
38
38
  // config.tsx
39
39
  import { jsx } from "react/jsx-runtime";
package/dist/editor.js CHANGED
@@ -84,6 +84,20 @@ function isValidHex(color) {
84
84
  return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
85
85
  }
86
86
  function hexToRgba(hex, opacity) {
87
+ if (hex.startsWith("rgba(")) {
88
+ const rgbaMatch = hex.match(
89
+ /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/
90
+ );
91
+ if (rgbaMatch) {
92
+ return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity / 100})`;
93
+ }
94
+ }
95
+ if (hex.startsWith("rgb(")) {
96
+ const rgbMatch = hex.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
97
+ if (rgbMatch) {
98
+ return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${opacity / 100})`;
99
+ }
100
+ }
87
101
  const sanitized = hex.replace("#", "");
88
102
  const r = parseInt(sanitized.slice(0, 2), 16);
89
103
  const g = parseInt(sanitized.slice(2, 4), 16);
package/dist/editor.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  createSpacingField,
17
17
  createThemeableColorField,
18
18
  createTypographyField
19
- } from "./chunk-SYXQQITG.mjs";
19
+ } from "./chunk-VF4NOAJG.mjs";
20
20
  import {
21
21
  allColorPresets,
22
22
  neutralColors
@@ -39,10 +39,10 @@ import {
39
39
  shadowPresets,
40
40
  useEntries,
41
41
  useTheme
42
- } from "./chunk-KV2RSRAM.mjs";
42
+ } from "./chunk-PJXZC564.mjs";
43
43
  import {
44
44
  DEFAULT_THEME
45
- } from "./chunk-D3L26TIT.mjs";
45
+ } from "./chunk-C6V3YUPF.mjs";
46
46
 
47
47
  // components/editor/TemplatesList.tsx
48
48
  import { usePuck } from "@measured/puck";
package/dist/index.js CHANGED
@@ -160,6 +160,20 @@ function useTheme() {
160
160
  var import_tailwind_merge = require("tailwind-merge");
161
161
  var import_clsx = require("clsx");
162
162
  function hexToRgba(hex, opacity) {
163
+ if (hex.startsWith("rgba(")) {
164
+ const rgbaMatch = hex.match(
165
+ /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/
166
+ );
167
+ if (rgbaMatch) {
168
+ return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity / 100})`;
169
+ }
170
+ }
171
+ if (hex.startsWith("rgb(")) {
172
+ const rgbMatch = hex.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
173
+ if (rgbMatch) {
174
+ return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${opacity / 100})`;
175
+ }
176
+ }
163
177
  const sanitized = hex.replace("#", "");
164
178
  const r = parseInt(sanitized.slice(0, 2), 16);
165
179
  const g = parseInt(sanitized.slice(2, 4), 16);
package/dist/index.mjs CHANGED
@@ -35,17 +35,17 @@ import {
35
35
  Topbar,
36
36
  VideoEmbed,
37
37
  availableIcons
38
- } from "./chunk-ML3AS3AY.mjs";
38
+ } from "./chunk-723Z3YKC.mjs";
39
39
  import {
40
40
  ThemeProvider,
41
41
  getShadowCSS,
42
42
  shadowPresets,
43
43
  useTheme
44
- } from "./chunk-KV2RSRAM.mjs";
44
+ } from "./chunk-PJXZC564.mjs";
45
45
  import "./chunk-QSWQDR6M.mjs";
46
46
  import {
47
47
  DEFAULT_THEME
48
- } from "./chunk-D3L26TIT.mjs";
48
+ } from "./chunk-C6V3YUPF.mjs";
49
49
  export {
50
50
  Button,
51
51
  Card,
package/dist/renderer.js CHANGED
@@ -147,6 +147,20 @@ function useTheme() {
147
147
  var import_tailwind_merge = require("tailwind-merge");
148
148
  var import_clsx = require("clsx");
149
149
  function hexToRgba(hex, opacity) {
150
+ if (hex.startsWith("rgba(")) {
151
+ const rgbaMatch = hex.match(
152
+ /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/
153
+ );
154
+ if (rgbaMatch) {
155
+ return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity / 100})`;
156
+ }
157
+ }
158
+ if (hex.startsWith("rgb(")) {
159
+ const rgbMatch = hex.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
160
+ if (rgbMatch) {
161
+ return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${opacity / 100})`;
162
+ }
163
+ }
150
164
  const sanitized = hex.replace("#", "");
151
165
  const r = parseInt(sanitized.slice(0, 2), 16);
152
166
  const g = parseInt(sanitized.slice(2, 4), 16);
package/dist/renderer.mjs CHANGED
@@ -20,15 +20,15 @@ import {
20
20
  Topbar,
21
21
  VideoEmbed,
22
22
  availableIcons
23
- } from "./chunk-ML3AS3AY.mjs";
23
+ } from "./chunk-723Z3YKC.mjs";
24
24
  import {
25
25
  ThemeProvider,
26
26
  useTheme
27
- } from "./chunk-KV2RSRAM.mjs";
27
+ } from "./chunk-PJXZC564.mjs";
28
28
  import "./chunk-QSWQDR6M.mjs";
29
29
  import {
30
30
  DEFAULT_THEME
31
- } from "./chunk-D3L26TIT.mjs";
31
+ } from "./chunk-C6V3YUPF.mjs";
32
32
  export {
33
33
  Button,
34
34
  Card,
@@ -73,6 +73,20 @@ var DEFAULT_THEME = {
73
73
  var import_tailwind_merge = require("tailwind-merge");
74
74
  var import_clsx = require("clsx");
75
75
  function hexToRgba(hex, opacity) {
76
+ if (hex.startsWith("rgba(")) {
77
+ const rgbaMatch = hex.match(
78
+ /rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/
79
+ );
80
+ if (rgbaMatch) {
81
+ return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${opacity / 100})`;
82
+ }
83
+ }
84
+ if (hex.startsWith("rgb(")) {
85
+ const rgbMatch = hex.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
86
+ if (rgbMatch) {
87
+ return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${opacity / 100})`;
88
+ }
89
+ }
76
90
  const sanitized = hex.replace("#", "");
77
91
  const r = parseInt(sanitized.slice(0, 2), 16);
78
92
  const g = parseInt(sanitized.slice(2, 4), 16);
@@ -148,7 +162,7 @@ function resolveProp(theme, entries, value) {
148
162
  return resolveThemeableColor(theme, value);
149
163
  }
150
164
  if (isColorValue(value)) {
151
- return value;
165
+ return resolveThemeableColor(theme, value);
152
166
  }
153
167
  if (typeof value === "object" && value !== null && "useEntry" in value) {
154
168
  return resolveEntryValue(entries, value);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_THEME,
3
3
  hexToRgba
4
- } from "../chunk-D3L26TIT.mjs";
4
+ } from "../chunk-C6V3YUPF.mjs";
5
5
 
6
6
  // resolve/theme.ts
7
7
  function resolveThemeColor(theme, themeKey) {
@@ -71,7 +71,7 @@ function resolveProp(theme, entries, value) {
71
71
  return resolveThemeableColor(theme, value);
72
72
  }
73
73
  if (isColorValue(value)) {
74
- return value;
74
+ return resolveThemeableColor(theme, value);
75
75
  }
76
76
  if (typeof value === "object" && value !== null && "useEntry" in value) {
77
77
  return resolveEntryValue(entries, value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mission-studio/puck",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "A collection of puck components and configurations for internal use at Mission Studio.",
5
5
  "repository": {
6
6
  "type": "git",