@se-studio/core-ui 1.0.119 → 1.0.121

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @se-studio/core-ui
2
2
 
3
+ ## 1.0.121
4
+
5
+ ### Patch Changes
6
+
7
+ - Bulk version bump: patch for all packages
8
+ - Updated dependencies
9
+ - @se-studio/contentful-rest-api@1.0.121
10
+ - @se-studio/core-data-types@1.0.121
11
+
12
+ ## 1.0.120
13
+
14
+ ### Patch Changes
15
+
16
+ - Bulk version bump: patch for all packages
17
+ - Updated dependencies
18
+ - @se-studio/contentful-rest-api@1.0.120
19
+ - @se-studio/core-data-types@1.0.120
20
+
3
21
  ## 1.0.119
4
22
 
5
23
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"HtmlComponent.d.ts","sourceRoot":"","sources":["../../src/components/HtmlComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAKrE,0FAA0F;AAC1F,eAAO,MAAM,sCAAsC,8DACU,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,mHAAmH;IACnH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kFAAkF;IAClF,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,0BAA0B,GAC3B,EAAE,kBAAkB,2CA0BpB"}
1
+ {"version":3,"file":"HtmlComponent.d.ts","sourceRoot":"","sources":["../../src/components/HtmlComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAKrE,0FAA0F;AAC1F,eAAO,MAAM,sCAAsC,8DACU,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,mHAAmH;IACnH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kFAAkF;IAClF,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,0BAA0B,GAC3B,EAAE,kBAAkB,2CAiCpB"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Script from 'next/script';
3
2
  import { cn } from '../utils/cn';
4
3
  import { scopeCss } from '../utils/scopeCss';
4
+ import { HtmlComponentScript } from './HtmlComponentScript';
5
5
  /** Default Tailwind breakout when `fullWidth` is true and no renderer override is set. */
6
6
  export const defaultHtmlComponentFullWidthClassName = 'relative left-1/2 w-screen max-w-[100vw] -translate-x-1/2';
7
7
  /**
@@ -17,6 +17,11 @@ export const defaultHtmlComponentFullWidthClassName = 'relative left-1/2 w-scree
17
17
  export function HtmlComponent({ id, rawHtml, customCss, customJs, fullWidth, scriptStrategy, loadScriptOnce, flowPositionIndex, fullWidthBreakoutClassName, }) {
18
18
  const scopedCss = customCss ? scopeCss(customCss, id) : undefined;
19
19
  const scriptId = loadScriptOnce ? `hc-${id}` : `hc-${id}-${flowPositionIndex}`;
20
+ // Prepend a scoped root variable so authors can write `hcRoot.querySelector(...)` instead of
21
+ // `document.querySelector('[data-hc-id]')` which would match the first component on the page.
22
+ const scopedJs = customJs
23
+ ? `const hcRoot = document.querySelector('[data-hc-id="${id}"]');\n${customJs}`
24
+ : undefined;
20
25
  let breakout;
21
26
  if (fullWidth) {
22
27
  if (fullWidthBreakoutClassName !== undefined) {
@@ -27,6 +32,6 @@ export function HtmlComponent({ id, rawHtml, customCss, customJs, fullWidth, scr
27
32
  breakout = defaultHtmlComponentFullWidthClassName;
28
33
  }
29
34
  }
30
- return (_jsxs("div", { "data-hc-id": id, "data-hc-fullwidth": fullWidth ? '' : undefined, className: cn(breakout), children: [scopedCss && _jsx("style", { children: scopedCss }), _jsx("div", { dangerouslySetInnerHTML: { __html: rawHtml } }), customJs && (_jsx(Script, { id: scriptId, strategy: scriptStrategy, children: customJs }))] }));
35
+ return (_jsxs("div", { "data-hc-id": id, "data-hc-fullwidth": fullWidth ? '' : undefined, className: cn(breakout), children: [scopedCss && _jsx("style", { children: scopedCss }), _jsx("div", { dangerouslySetInnerHTML: { __html: rawHtml } }), scopedJs && (_jsx(HtmlComponentScript, { customJs: scopedJs, scriptStrategy: scriptStrategy, scriptId: scriptId }))] }));
31
36
  }
32
37
  //# sourceMappingURL=HtmlComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HtmlComponent.js","sourceRoot":"","sources":["../../src/components/HtmlComponent.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,0FAA0F;AAC1F,MAAM,CAAC,MAAM,sCAAsC,GACjD,2DAA2D,CAAC;AAS9D;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,EAAE,EACF,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,0BAA0B,GACP;IACnB,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,iBAAiB,EAAE,CAAC;IA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AC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,iBAAiB,EAAE,CAAC;IAC/E,6FAA6F;IAC7F,8FAA8F;IAC9F,MAAM,QAAQ,GAAG,QAAQ;QACvB,CAAC,CAAC,uDAAuD,EAAE,UAAU,QAAQ,EAAE;QAC/E,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,QAA4B,CAAC;IACjC,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,0BAA0B,KAAK,SAAS,EAAE,CAAC;YAC7C,MAAM,CAAC,GAAG,0BAA0B,CAAC,IAAI,EAAE,CAAC;YAC5C,QAAQ,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,sCAAsC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,OAAO,CACL,6BAAiB,EAAE,uBAAqB,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,aACxF,SAAS,IAAI,0BAAQ,SAAS,GAAS,EAExC,cAAK,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAI,EACpD,QAAQ,IAAI,CACX,KAAC,mBAAmB,IAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,GAClB,CACH,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { IBaseHtmlComponent } from '@se-studio/core-data-types';
2
+ /**
3
+ * Client component wrapper for next/script with inline content.
4
+ * next/script with afterInteractive/lazyOnload strategies and inline children
5
+ * requires a Client Component to inject — it is a no-op in Server Components.
6
+ */
7
+ export declare function HtmlComponentScript({ customJs, scriptStrategy, scriptId, }: {
8
+ customJs: string;
9
+ scriptStrategy: IBaseHtmlComponent['scriptStrategy'];
10
+ scriptId: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=HtmlComponentScript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlComponentScript.d.ts","sourceRoot":"","sources":["../../src/components/HtmlComponentScript.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGrE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,cAAc,EACd,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACrD,QAAQ,EAAE,MAAM,CAAC;CAClB,2CAMA"}
@@ -0,0 +1,12 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import Script from 'next/script';
4
+ /**
5
+ * Client component wrapper for next/script with inline content.
6
+ * next/script with afterInteractive/lazyOnload strategies and inline children
7
+ * requires a Client Component to inject — it is a no-op in Server Components.
8
+ */
9
+ export function HtmlComponentScript({ customJs, scriptStrategy, scriptId, }) {
10
+ return (_jsx(Script, { id: scriptId, strategy: scriptStrategy, children: customJs }));
11
+ }
12
+ //# sourceMappingURL=HtmlComponentScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlComponentScript.js","sourceRoot":"","sources":["../../src/components/HtmlComponentScript.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,cAAc,EACd,QAAQ,GAKT;IACC,OAAO,CACL,KAAC,MAAM,IAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,YAC3C,QAAQ,GACF,CACV,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/core-ui",
3
- "version": "1.0.119",
3
+ "version": "1.0.121",
4
4
  "description": "Shared React UI component library with Tailwind CSS v4 for SE Studio applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -68,8 +68,8 @@
68
68
  "mustache": "4.2.0",
69
69
  "server-only": "0.0.1",
70
70
  "tailwind-merge": "^3.5.0",
71
- "@se-studio/contentful-rest-api": "1.0.119",
72
- "@se-studio/core-data-types": "1.0.119"
71
+ "@se-studio/contentful-rest-api": "1.0.121",
72
+ "@se-studio/core-data-types": "1.0.121"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@biomejs/biome": "^2.4.10",