maquinaweb-ui 2.65.1 → 2.66.0

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.
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, ElementType } from "react";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/container-animation/container-animation.d.ts
5
5
  type ContainerAnimationProps<T extends ElementType = 'div'> = ComponentProps<'div'> & ComponentProps<T> & {
@@ -23,7 +23,7 @@ declare const ContainerAnimation: <T extends ElementType = "div">({
23
23
  distance,
24
24
  hideNotInView,
25
25
  ...props
26
- }: ContainerAnimationProps<T>) => react_jsx_runtime2.JSX.Element;
26
+ }: ContainerAnimationProps<T>) => react_jsx_runtime1.JSX.Element;
27
27
  //#endregion
28
28
  export { ContainerAnimation, ContainerAnimationProps };
29
29
  //# sourceMappingURL=container-animation.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { FieldPath, FieldValues, UseControllerProps } from "react-hook-form";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
3
3
  import { Matcher } from "react-day-picker";
4
4
 
5
5
  //#region src/components/date-field/DateField.d.ts
@@ -29,7 +29,7 @@ declare function DateField<TFieldValues extends FieldValues = FieldValues, TFiel
29
29
  required,
30
30
  help,
31
31
  dateOnly
32
- }: DateFieldProps<TFieldValues, TFieldName>): react_jsx_runtime3.JSX.Element;
32
+ }: DateFieldProps<TFieldValues, TFieldName>): react_jsx_runtime11.JSX.Element;
33
33
  //#endregion
34
34
  export { DateField, DateFieldProps };
35
35
  //# sourceMappingURL=DateField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateField.d.ts","names":[],"sources":["../../src/components/date-field/DateField.tsx"],"sourcesContent":[],"mappings":";;;;;UA4BiB,oCACM,cAAc,gCAChB,UAAU,gBAAgB,UAAU,uBAC/C,K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,mBAYF,SAZE,CAYQ,YAZR,CAAA,GAYwB,SAZxB,CAYkC,YAZlC,CAAA,CAAA,CAAA;EAAA,IAAA;EAAA,KAAA;EAAA,WAAA;EAAA,aAAA;EAAA,QAAA;EAAA,SAAA;EAAA,QAAA;EAAA,YAAA;EAAA,QAAA;EAAA,IAAA;EAAA;AAAA,CAAA,EAyBpB,cAzBoB,CAyBL,YAzBK,EAyBS,UAzBT,CAAA,CAAA,EAyBoB,mBAAA,CAAA,GAAA,CAAA,OAzBpB"}
@@ -1,5 +1,5 @@
1
1
  import { FieldPath, FieldValues, UseControllerProps } from "react-hook-form";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
  import { Matcher } from "react-day-picker";
4
4
 
5
5
  //#region src/components/date-hour-field/DateHourField.d.ts
@@ -29,7 +29,7 @@ declare function DateHourField<TFieldValues extends FieldValues = FieldValues, T
29
29
  help,
30
30
  hourPlaceholder,
31
31
  valueType
32
- }: DateHourFieldProps<TFieldValues, TFieldName>): react_jsx_runtime4.JSX.Element;
32
+ }: DateHourFieldProps<TFieldValues, TFieldName>): react_jsx_runtime2.JSX.Element;
33
33
  //#endregion
34
34
  export { DateHourField, DateHourFieldProps };
35
35
  //# sourceMappingURL=DateHourField.d.ts.map
@@ -1,2 +1,3 @@
1
- import { LandingContentDefinitionItem, LandingContentDefinitionSection, LandingContentName, LandingPageContentApiItem, LandingPageContentDefinition, LandingPageKey, ResolvedLandingContentItem, ResolvedLandingPageContent, buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, getLandingPageContentCached, parseLandingContentName, setLandingPageDefaults } from "./landing-text/landing-content.js";
2
- export { type LandingContentDefinitionItem, type LandingContentDefinitionSection, type LandingContentName, type LandingPageContentApiItem, type LandingPageContentDefinition, type LandingPageKey, type ResolvedLandingContentItem, type ResolvedLandingPageContent, buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, getLandingPageContentCached, parseLandingContentName, setLandingPageDefaults };
1
+ import { LandingContentDefinitionItem, LandingContentDefinitionSection, LandingContentName, LandingPageContentApiItem, LandingPageContentDefinition, LandingPageKey, ResolvedLandingContentItem, ResolvedLandingPageContent } from "./landing-text/types.js";
2
+ import { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, parseLandingContentName, setLandingPageDefaults } from "./landing-text/landing-content.js";
3
+ export { type LandingContentDefinitionItem, type LandingContentDefinitionSection, type LandingContentName, type LandingPageContentApiItem, type LandingPageContentDefinition, type LandingPageKey, type ResolvedLandingContentItem, type ResolvedLandingPageContent, buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, parseLandingContentName, setLandingPageDefaults };
@@ -1,3 +1,3 @@
1
- import { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, getLandingPageContentCached, parseLandingContentName, setLandingPageDefaults } from "./landing-text/landing-content.js";
1
+ import { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, parseLandingContentName, setLandingPageDefaults } from "./landing-text/landing-content.js";
2
2
 
3
- export { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, getLandingPageContentCached, parseLandingContentName, setLandingPageDefaults };
3
+ export { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, parseLandingContentName, setLandingPageDefaults };
@@ -93,7 +93,7 @@ function ClientLandingText({ item, editable, children }) {
93
93
  children: [editable && isEditing && /* @__PURE__ */ jsxs("div", {
94
94
  className: "absolute right-0 z-10 h-fit -top-7 flex",
95
95
  children: [/* @__PURE__ */ jsx(Button, {
96
- className: "h-6 w-6 rounded-none p-0",
96
+ className: "size-6 rounded-none p-0",
97
97
  disabled: isSaving,
98
98
  onClick: handleCancel,
99
99
  size: "icon",
@@ -101,7 +101,7 @@ function ClientLandingText({ item, editable, children }) {
101
101
  variant: "outline",
102
102
  children: /* @__PURE__ */ jsx(X, {})
103
103
  }), /* @__PURE__ */ jsx(Button, {
104
- className: "h-6 w-6 rounded-none p-0",
104
+ className: "size-6 rounded-none p-0",
105
105
  disabled: isSaving,
106
106
  onClick: handleSave,
107
107
  size: "icon",
@@ -1 +1 @@
1
- {"version":3,"file":"client-landing-text.js","names":[],"sources":["../../src/components/landing-text/client-landing-text.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useState } from 'react';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { Button } from '../ui/button';\n\nimport { Check, X } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport type { LandingTextItem } from './landing-text';\n\ninterface ClientLandingTextProps {\n item: LandingTextItem;\n editable: boolean;\n children: React.ReactNode;\n}\n\nfunction labelFromKey(value: string) {\n if (!value) {\n return '';\n }\n\n return value\n .split(/[-_\\.]/g)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}\n\nfunction normalizeBaseUrl(baseUrl: string): string {\n return baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;\n}\n\nfunction getCookieValue(name: string): string | undefined {\n if (typeof document === 'undefined') {\n return undefined;\n }\n\n const key = `${encodeURIComponent(name)}=`;\n const cookies = document.cookie ? document.cookie.split('; ') : [];\n\n for (const cookie of cookies) {\n if (!cookie.startsWith(key)) {\n continue;\n }\n\n return decodeURIComponent(cookie.slice(key.length));\n }\n\n return undefined;\n}\n\nasync function persistLandingContent(item: LandingTextItem, value: string) {\n const baseUrl = String(process.env.NEXT_PUBLIC_BASE_URL || '');\n const organization = process.env.NEXT_PUBLIC_ORGANIZATION_ID || '';\n\n if (!baseUrl) {\n return;\n }\n\n const token = getCookieValue('token');\n\n if (!token || !organization) {\n throw new Error(\n 'Credenciais de edição indisponíveis para salvar conteúdo.'\n );\n }\n\n const endpoint = '/landing-page-contents/upsert/';\n const response = await fetch(`${normalizeBaseUrl(baseUrl)}${endpoint}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Token ${token}`,\n 'X-Organization': organization,\n },\n body: JSON.stringify({\n page_key: item.pageKey,\n page_title: labelFromKey(item.pageKey),\n section_key: item.sectionKey,\n section_title: labelFromKey(item.sectionKey),\n content_key: item.contentKey,\n content_title: labelFromKey(item.contentKey),\n value,\n default_value: item.defaultValue,\n metadata: item.metadata,\n }),\n credentials: 'include',\n });\n\n if (!response.ok) {\n throw new Error('Nao foi possivel salvar o conteudo.');\n }\n}\n\nfunction ClientLandingText({\n item,\n editable,\n children,\n}: ClientLandingTextProps) {\n const [isEditing, setIsEditing] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n const [currentValue, setCurrentValue] = useState(item.value);\n const [draftValue, setDraftValue] = useState(item.value);\n const ref = useRef<HTMLElement | null>(null);\n\n const handleEdit = (event: React.MouseEvent<HTMLElement>) => {\n if (!editable || isSaving) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n const nextDraft = ref.current?.innerText ?? currentValue;\n setDraftValue(nextDraft);\n setIsEditing(true);\n\n requestAnimationFrame(() => {\n ref.current?.focus();\n });\n };\n\n const handleCancel = () => {\n if (ref.current) {\n ref.current.innerText = currentValue;\n }\n setDraftValue(currentValue);\n setIsEditing(false);\n };\n\n const handleSave = async () => {\n try {\n setIsSaving(true);\n await persistLandingContent(item, draftValue);\n setCurrentValue(draftValue);\n if (ref.current) {\n ref.current.innerText = draftValue;\n }\n setIsEditing(false);\n } finally {\n setIsSaving(false);\n }\n };\n\n const handleInput = (event: React.FormEvent<HTMLElement>) => {\n if (!isEditing) {\n return;\n }\n setDraftValue(event.currentTarget.innerText);\n };\n\n return (\n <div className=\"relative\">\n {editable && isEditing && (\n <div className=\"absolute right-0 z-10 h-fit -top-7 flex\">\n <Button\n className=\"h-6 w-6 rounded-none p-0\"\n disabled={isSaving}\n onClick={handleCancel}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n >\n <X />\n </Button>\n <Button\n className=\"h-6 w-6 rounded-none p-0\"\n disabled={isSaving}\n onClick={handleSave}\n size=\"icon\"\n type=\"button\"\n >\n <Check />\n </Button>\n </div>\n )}\n\n <Slot\n className={cn(\n 'relative',\n 'after:z-10 after:w-full after:h-full after:absolute after:left-1/2 after:-translate-x-1/2 after:top-1/2 after:-translate-y-1/2 after:box-content after:p-1',\n editable && 'hover:after:border hover:after:border-input',\n isEditing && 'after:border after:border-input',\n isEditing && 'outline-none cursor-text before:bg-red-500',\n !editable && 'after:hidden'\n )}\n contentEditable={editable && isEditing}\n onClick={handleEdit}\n onInput={handleInput}\n ref={ref}\n suppressContentEditableWarning\n >\n {children}\n </Slot>\n </div>\n );\n}\n\nexport { ClientLandingText };\n"],"mappings":";;;;;;;;;;;AAkBA,SAAS,aAAa,OAAe;AACnC,KAAI,CAAC,MACH,QAAO;AAGT,QAAO,MACJ,MAAM,UAAU,CAChB,OAAO,QAAQ,CACf,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,IAAI;;AAGd,SAAS,iBAAiB,SAAyB;AACjD,QAAO,QAAQ,SAAS,IAAI,GAAG,QAAQ,MAAM,GAAG,GAAG,GAAG;;AAGxD,SAAS,eAAe,MAAkC;AACxD,KAAI,OAAO,aAAa,YACtB;CAGF,MAAM,MAAM,GAAG,mBAAmB,KAAK,CAAC;CACxC,MAAM,UAAU,SAAS,SAAS,SAAS,OAAO,MAAM,KAAK,GAAG,EAAE;AAElE,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,CAAC,OAAO,WAAW,IAAI,CACzB;AAGF,SAAO,mBAAmB,OAAO,MAAM,IAAI,OAAO,CAAC;;;AAMvD,eAAe,sBAAsB,MAAuB,OAAe;CACzE,MAAM,UAAU,OAAO,QAAQ,IAAI,wBAAwB,GAAG;CAC9D,MAAM,eAAe,QAAQ,IAAI,+BAA+B;AAEhE,KAAI,CAAC,QACH;CAGF,MAAM,QAAQ,eAAe,QAAQ;AAErC,KAAI,CAAC,SAAS,CAAC,aACb,OAAM,IAAI,MACR,4DACD;AAyBH,KAAI,EArBa,MAAM,MAAM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UAAU;;AAG9C,QACE,qBAAC;EAAI,WAAU;aACZ,YAAY,aACX,qBAAC;GAAI,WAAU;cACb,oBAAC;IACC,WAAU;IACV,UAAU;IACV,SAAS;IACT,MAAK;IACL,MAAK;IACL,SAAQ;cAER,oBAAC,MAAI;KACE,EACT,oBAAC;IACC,WAAU;IACV,UAAU;IACV,SAAS;IACT,MAAK;IACL,MAAK;cAEL,oBAAC,UAAQ;KACF;IACL,EAGR,oBAAC;GACC,WAAW,GACT,YACA,8JACA,YAAY,+CACZ,aAAa,mCACb,aAAa,8CACb,CAAC,YAAY,eACd;GACD,iBAAiB,YAAY;GAC7B,SAAS;GACT,SAAS;GACJ;GACL;GAEC;IACI;GACH"}
1
+ {"version":3,"file":"client-landing-text.js","names":[],"sources":["../../src/components/landing-text/client-landing-text.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useState } from 'react';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { Button } from '../ui/button';\n\nimport { Check, X } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport type { LandingTextItem } from './types';\n\ninterface ClientLandingTextProps {\n item: LandingTextItem;\n editable: boolean;\n children: React.ReactNode;\n}\n\nfunction labelFromKey(value: string) {\n if (!value) {\n return '';\n }\n\n return value\n .split(/[-_\\.]/g)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}\n\nfunction normalizeBaseUrl(baseUrl: string): string {\n return baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;\n}\n\nfunction getCookieValue(name: string): string | undefined {\n if (typeof document === 'undefined') {\n return undefined;\n }\n\n const key = `${encodeURIComponent(name)}=`;\n const cookies = document.cookie ? document.cookie.split('; ') : [];\n\n for (const cookie of cookies) {\n if (!cookie.startsWith(key)) {\n continue;\n }\n\n return decodeURIComponent(cookie.slice(key.length));\n }\n\n return undefined;\n}\n\nasync function persistLandingContent(item: LandingTextItem, value: string) {\n const baseUrl = String(process.env.NEXT_PUBLIC_BASE_URL || '');\n const organization = process.env.NEXT_PUBLIC_ORGANIZATION_ID || '';\n\n if (!baseUrl) {\n return;\n }\n\n const token = getCookieValue('token');\n\n if (!token || !organization) {\n throw new Error(\n 'Credenciais de edição indisponíveis para salvar conteúdo.'\n );\n }\n\n const endpoint = '/landing-page-contents/upsert/';\n const response = await fetch(`${normalizeBaseUrl(baseUrl)}${endpoint}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Token ${token}`,\n 'X-Organization': organization,\n },\n body: JSON.stringify({\n page_key: item.pageKey,\n page_title: labelFromKey(item.pageKey),\n section_key: item.sectionKey,\n section_title: labelFromKey(item.sectionKey),\n content_key: item.contentKey,\n content_title: labelFromKey(item.contentKey),\n value,\n default_value: item.defaultValue,\n metadata: item.metadata,\n }),\n credentials: 'include',\n });\n\n if (!response.ok) {\n throw new Error('Nao foi possivel salvar o conteudo.');\n }\n}\n\nfunction ClientLandingText({\n item,\n editable,\n children,\n}: ClientLandingTextProps) {\n const [isEditing, setIsEditing] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n const [currentValue, setCurrentValue] = useState(item.value);\n const [draftValue, setDraftValue] = useState(item.value);\n const ref = useRef<HTMLElement | null>(null);\n\n const handleEdit = (event: React.MouseEvent<HTMLElement>) => {\n if (!editable || isSaving) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n const nextDraft = ref.current?.innerText ?? currentValue;\n setDraftValue(nextDraft);\n setIsEditing(true);\n\n requestAnimationFrame(() => {\n ref.current?.focus();\n });\n };\n\n const handleCancel = () => {\n if (ref.current) {\n ref.current.innerText = currentValue;\n }\n setDraftValue(currentValue);\n setIsEditing(false);\n };\n\n const handleSave = async () => {\n try {\n setIsSaving(true);\n await persistLandingContent(item, draftValue);\n setCurrentValue(draftValue);\n if (ref.current) {\n ref.current.innerText = draftValue;\n }\n setIsEditing(false);\n } finally {\n setIsSaving(false);\n }\n };\n\n const handleInput = (event: React.FormEvent<HTMLElement>) => {\n if (!isEditing) {\n return;\n }\n setDraftValue(event.currentTarget.innerText);\n };\n\n return (\n <div className=\"relative\">\n {editable && isEditing && (\n <div className=\"absolute right-0 z-10 h-fit -top-7 flex\">\n <Button\n className=\"size-6 rounded-none p-0\"\n disabled={isSaving}\n onClick={handleCancel}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n >\n <X />\n </Button>\n <Button\n className=\"size-6 rounded-none p-0\"\n disabled={isSaving}\n onClick={handleSave}\n size=\"icon\"\n type=\"button\"\n >\n <Check />\n </Button>\n </div>\n )}\n\n <Slot\n className={cn(\n 'relative',\n 'after:z-10 after:w-full after:h-full after:absolute after:left-1/2 after:-translate-x-1/2 after:top-1/2 after:-translate-y-1/2 after:box-content after:p-1',\n editable && 'hover:after:border hover:after:border-input',\n isEditing && 'after:border after:border-input',\n isEditing && 'outline-none cursor-text before:bg-red-500',\n !editable && 'after:hidden'\n )}\n contentEditable={editable && isEditing}\n onClick={handleEdit}\n onInput={handleInput}\n ref={ref}\n suppressContentEditableWarning\n >\n {children}\n </Slot>\n </div>\n );\n}\n\nexport { ClientLandingText };\n"],"mappings":";;;;;;;;;;;AAkBA,SAAS,aAAa,OAAe;AACnC,KAAI,CAAC,MACH,QAAO;AAGT,QAAO,MACJ,MAAM,UAAU,CAChB,OAAO,QAAQ,CACf,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,IAAI;;AAGd,SAAS,iBAAiB,SAAyB;AACjD,QAAO,QAAQ,SAAS,IAAI,GAAG,QAAQ,MAAM,GAAG,GAAG,GAAG;;AAGxD,SAAS,eAAe,MAAkC;AACxD,KAAI,OAAO,aAAa,YACtB;CAGF,MAAM,MAAM,GAAG,mBAAmB,KAAK,CAAC;CACxC,MAAM,UAAU,SAAS,SAAS,SAAS,OAAO,MAAM,KAAK,GAAG,EAAE;AAElE,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,CAAC,OAAO,W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AAI,QACN,KAAI,QAAQ,YAAY;AAE1B,gBAAc,aAAa;AAC3B,eAAa,MAAM;;CAGrB,MAAM,aAAa,YAAY;AAC7B,MAAI;AACF,eAAY,KAAK;AACjB,SAAM,sBAAsB,MAAM,WAAW;AAC7C,mBAAgB,WAAW;AAC3B,OAAI,IAAI,QACN,KAAI,QAAQ,YAAY;AAE1B,gBAAa,MAAM;YACX;AACR,eAAY,MAAM;;;CAItB,MAAM,eAAe,UAAwC;AAC3D,MAAI,CAAC,UACH;AAEF,gBAAc,MAAM,cAAc,UAAU;;AAG9C,QACE,qBAAC;EAAI,WAAU;aACZ,YAAY,aACX,qBAAC;GAAI,WAAU;cACb,oBAAC;IACC,WAAU;IACV,UAAU;IACV,SAAS;IACT,MAAK;IACL,MAAK;IACL,SAAQ;cAER,oBAAC,MAAI;KACE,EACT,oBAAC;IACC,WAAU;IACV,UAAU;IACV,SAAS;IACT,MAAK;IACL,MAAK;cAEL,oBAAC,UAAQ;KACF;IACL,EAGR,oBAAC;GACC,WAAW,GACT,YACA,8JACA,YAAY,+CACZ,aAAa,mCACb,aAAa,8CACb,CAAC,YAAY,eACd;GACD,iBAAiB,YAAY;GAC7B,SAAS;GACT,SAAS;GACJ;GACL;GAEC;IACI;GACH"}
@@ -1,45 +1,10 @@
1
+ import { LandingContentName, LandingPageContentDefinition, LandingPageKey, ResolvedLandingContentItem, ResolvedLandingPageContent } from "./types.js";
1
2
  import "server-only";
2
3
 
3
4
  //#region src/components/landing-text/landing-content.d.ts
4
- type LandingPageKey = string;
5
- type LandingContentName = `${string}.${string}.${string}`;
6
- interface LandingContentDefinitionItem {
7
- contentKey: string;
8
- value: string;
9
- metadata?: Record<string, unknown>;
10
- }
11
- interface LandingContentDefinitionSection {
12
- sectionKey: string;
13
- contents: LandingContentDefinitionItem[];
14
- }
15
- interface LandingPageContentDefinition {
16
- pageKey: string;
17
- sections: LandingContentDefinitionSection[];
18
- }
19
- interface LandingPageContentApiItem {
20
- page_key: string;
21
- section_key: string;
22
- content_key: string;
23
- value: string;
24
- metadata?: Record<string, unknown>;
25
- }
26
- interface ResolvedLandingContentItem {
27
- pageKey: string;
28
- sectionKey: string;
29
- contentKey: string;
30
- value: string;
31
- defaultValue: string;
32
- metadata: Record<string, unknown>;
33
- }
34
- interface ResolvedLandingPageContent {
35
- pageKey: string;
36
- editable: boolean;
37
- contents: Record<string, ResolvedLandingContentItem>;
38
- }
39
5
  declare function setLandingPageDefaults(defaults: Record<LandingPageKey, LandingPageContentDefinition>): void;
40
6
  declare function buildContentId(sectionKey: string, contentKey: string): string;
41
7
  declare function getLandingPageContent(pageKey: LandingPageKey): Promise<ResolvedLandingPageContent>;
42
- declare const getLandingPageContentCached: (pageKey: LandingPageKey) => Promise<ResolvedLandingPageContent>;
43
8
  declare function parseLandingContentName(name: string): {
44
9
  pageKey: string;
45
10
  sectionKey: string;
@@ -51,5 +16,5 @@ declare function getLandingContentByName(name: LandingContentName): Promise<{
51
16
  item: ResolvedLandingContentItem;
52
17
  }>;
53
18
  //#endregion
54
- export { LandingContentDefinitionItem, LandingContentDefinitionSection, LandingContentName, LandingPageContentApiItem, LandingPageContentDefinition, LandingPageKey, ResolvedLandingContentItem, ResolvedLandingPageContent, buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, getLandingPageContentCached, parseLandingContentName, setLandingPageDefaults };
19
+ export { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, parseLandingContentName, setLandingPageDefaults };
55
20
  //# sourceMappingURL=landing-content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"landing-content.d.ts","names":[],"sources":["../../src/components/landing-text/landing-content.ts"],"sourcesContent":[],"mappings":";;;KAKY,cAAA;KACA,kBAAA;AADA,UAGK,4BAAA,CAHS;EACd,UAAA,EAAA,MAAA;EAEK,KAAA,EAAA,MAAA;EAMA,QAAA,CAAA,EAHJ,MAGI,CAAA,MAAA,EAAA,OAAA,CAA+B;AAKhD;AAKiB,UAVA,+BAAA,CAeJ;EA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B,IAAA;AAmDM,iBAsEN,qBAAA,CAtE2B,OAAA,EAuEhC,0BAvEgC,EAAA,UAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAyEvB,0BAzEuB;AAChC,iBAsFW,uBAAA,CAtFX,IAAA,EAsFyC,kBAtFzC,CAAA,EAsF2D,OAtF3D,CAAA;EACA,QAAA,EAAA,OAAA;EAAR,IAAA,EAkGQ,0BAlGR;CAAO,CAAA"}
@@ -13,61 +13,61 @@ function setLandingPageDefaults(defaults) {
13
13
  function buildContentId(sectionKey, contentKey) {
14
14
  return `${sectionKey}.${contentKey}`;
15
15
  }
16
- function normalizeBaseUrl(baseUrl) {
17
- return baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
16
+ function toApiUrl(path) {
17
+ const baseUrl = String(process.env.NEXT_PUBLIC_BASE_URL || "").replace(/\/$/, "");
18
+ return baseUrl ? `${baseUrl}${path}` : "";
18
19
  }
19
- async function getLandingPageContent(pageKey) {
20
- const defaults = pageDefaults[pageKey] || {
21
- pageKey,
22
- sections: []
23
- };
24
- const organizationId = process.env.NEXT_PUBLIC_ORGANIZATION_ID;
25
- const baseUrl = normalizeBaseUrl(String(process.env.NEXT_PUBLIC_BASE_URL || ""));
20
+ async function getEditableState() {
26
21
  const cookieStore = await cookies();
27
- const token = cookieStore.get("token")?.value;
28
- const organization = cookieStore.get("organization")?.value;
29
- const editable = Boolean(token && organization);
30
- let overrides = [];
31
- if (baseUrl && organizationId) try {
32
- const response = await fetch(`${baseUrl}/public/landing-page-contents/?page_key=${encodeURIComponent(pageKey)}`, {
22
+ return Boolean(cookieStore.get("token")?.value && cookieStore.get("organization")?.value);
23
+ }
24
+ async function getLandingOverrides(pageKey) {
25
+ const organizationId = process.env.NEXT_PUBLIC_ORGANIZATION_ID;
26
+ const url = toApiUrl(`/public/landing-page-contents/?page_key=${encodeURIComponent(pageKey)}`);
27
+ if (!organizationId || !url) return [];
28
+ try {
29
+ const response = await fetch(url, {
33
30
  headers: { "X-Organization": organizationId },
34
31
  next: { tags: ["landing-page-content", `landing-page-content-${pageKey}`] }
35
32
  });
36
- if (response.ok) overrides = await response.json();
37
- } catch (error) {
38
- overrides = [];
33
+ if (!response.ok) return [];
34
+ return response.json();
35
+ } catch {
36
+ return [];
39
37
  }
40
- const byId = /* @__PURE__ */ new Map();
41
- for (const item of overrides) byId.set(buildContentId(item.section_key, item.content_key), item);
42
- const contents = {};
43
- for (const section of defaults.sections) for (const item of section.contents) {
38
+ }
39
+ async function getLandingPageContent(pageKey) {
40
+ const defaults = pageDefaults[pageKey] ?? {
41
+ pageKey,
42
+ sections: []
43
+ };
44
+ const [editable, overrides] = await Promise.all([getEditableState(), getLandingOverrides(pageKey)]);
45
+ const byId = new Map(overrides.map((item) => [buildContentId(item.section_key, item.content_key), item]));
46
+ const contents = Object.fromEntries(defaults.sections.flatMap((section) => section.contents.map((item) => {
44
47
  const id = buildContentId(section.sectionKey, item.contentKey);
45
48
  const override = byId.get(id);
46
- contents[id] = {
49
+ return [id, {
47
50
  pageKey: defaults.pageKey,
48
51
  sectionKey: section.sectionKey,
49
52
  contentKey: item.contentKey,
50
- value: override ? override.value : item.value,
53
+ value: override?.value ?? item.value,
51
54
  defaultValue: item.value,
52
- metadata: override?.metadata || item.metadata || {}
53
- };
54
- }
55
+ metadata: override?.metadata ?? item.metadata ?? {}
56
+ }];
57
+ })));
55
58
  return {
56
59
  pageKey: defaults.pageKey,
57
60
  editable,
58
61
  contents
59
62
  };
60
63
  }
61
- const getLandingPageContentCached = cache(async (pageKey) => getLandingPageContent(pageKey));
62
- function isLandingPageKey(value) {
63
- return value in pageDefaults;
64
- }
64
+ const getLandingPageContentCached = cache(getLandingPageContent);
65
65
  function parseLandingContentName(name) {
66
66
  const [rawPageKey, rawSectionKey, ...contentParts] = name.split(".").map((part) => part.trim());
67
67
  const pageKey = rawPageKey || "";
68
68
  const sectionKey = rawSectionKey || "";
69
69
  const contentKey = contentParts.join(".").trim();
70
- if (!isLandingPageKey(pageKey) || !sectionKey || !contentKey) return null;
70
+ if (!pageDefaults[pageKey] || !sectionKey || !contentKey) return null;
71
71
  return {
72
72
  pageKey,
73
73
  sectionKey,
@@ -75,10 +75,7 @@ function parseLandingContentName(name) {
75
75
  };
76
76
  }
77
77
  function getLandingContentItem(content, sectionKey, contentKey) {
78
- const id = buildContentId(sectionKey, contentKey);
79
- const existing = content.contents[id];
80
- if (existing) return existing;
81
- return {
78
+ return content.contents[buildContentId(sectionKey, contentKey)] ?? {
82
79
  pageKey: content.pageKey,
83
80
  sectionKey,
84
81
  contentKey,
@@ -108,5 +105,5 @@ async function getLandingContentByName(name) {
108
105
  }
109
106
 
110
107
  //#endregion
111
- export { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, getLandingPageContentCached, parseLandingContentName, setLandingPageDefaults };
108
+ export { buildContentId, getLandingContentByName, getLandingContentItem, getLandingPageContent, parseLandingContentName, setLandingPageDefaults };
112
109
  //# sourceMappingURL=landing-content.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"landing-content.js","names":["pageDefaults: Record<LandingPageKey, LandingPageContentDefinition>","overrides: LandingPageContentApiItem[]","contents: Record<string, ResolvedLandingContentItem>"],"sources":["../../src/components/landing-text/landing-content.ts"],"sourcesContent":["import 'server-only';\n\nimport { cache } from 'react';\nimport { cookies } from 'next/headers';\n\nexport type LandingPageKey = string;\nexport type LandingContentName = `${string}.${string}.${string}`;\n\nexport interface LandingContentDefinitionItem {\n contentKey: string;\n value: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface LandingContentDefinitionSection {\n sectionKey: string;\n contents: LandingContentDefinitionItem[];\n}\n\nexport interface LandingPageContentDefinition {\n pageKey: string;\n sections: LandingContentDefinitionSection[];\n}\n\nexport interface LandingPageContentApiItem {\n page_key: string;\n section_key: string;\n content_key: string;\n value: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface ResolvedLandingContentItem {\n pageKey: string;\n sectionKey: string;\n contentKey: string;\n value: string;\n defaultValue: string;\n metadata: Record<string, unknown>;\n}\n\nexport interface ResolvedLandingPageContent {\n pageKey: string;\n editable: boolean;\n contents: Record<string, ResolvedLandingContentItem>;\n}\n\nlet pageDefaults: Record<LandingPageKey, LandingPageContentDefinition> = {};\n\nexport function setLandingPageDefaults(\n defaults: Record<LandingPageKey, LandingPageContentDefinition>\n) {\n pageDefaults = {\n ...pageDefaults,\n ...defaults,\n };\n}\n\nexport function buildContentId(sectionKey: string, contentKey: string) {\n return `${sectionKey}.${contentKey}`;\n}\n\nfunction normalizeBaseUrl(baseUrl: string) {\n return baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;\n}\n\nexport async function getLandingPageContent(\n pageKey: LandingPageKey\n): Promise<ResolvedLandingPageContent> {\n const defaults = pageDefaults[pageKey] || {\n pageKey,\n sections: [],\n };\n\n const organizationId = process.env.NEXT_PUBLIC_ORGANIZATION_ID;\n const baseUrl = normalizeBaseUrl(\n String(process.env.NEXT_PUBLIC_BASE_URL || '')\n );\n\n const cookieStore = await cookies();\n const token = cookieStore.get('token')?.value;\n const organization = cookieStore.get('organization')?.value;\n const editable = Boolean(token && organization);\n\n let overrides: LandingPageContentApiItem[] = [];\n\n if (baseUrl && organizationId) {\n try {\n const response = await fetch(\n `${baseUrl}/public/landing-page-contents/?page_key=${encodeURIComponent(\n pageKey\n )}`,\n {\n headers: {\n 'X-Organization': organizationId,\n },\n next: {\n tags: ['landing-page-content', `landing-page-content-${pageKey}`],\n },\n } as RequestInit & {\n next?: {\n tags?: string[];\n };\n }\n );\n\n if (response.ok) {\n overrides = await response.json();\n }\n } catch (error) {\n overrides = [];\n }\n }\n\n const byId = new Map<string, LandingPageContentApiItem>();\n for (const item of overrides) {\n byId.set(buildContentId(item.section_key, item.content_key), item);\n }\n\n const contents: Record<string, ResolvedLandingContentItem> = {};\n\n for (const section of defaults.sections) {\n for (const item of section.contents) {\n const id = buildContentId(section.sectionKey, item.contentKey);\n const override = byId.get(id);\n\n contents[id] = {\n pageKey: defaults.pageKey,\n sectionKey: section.sectionKey,\n contentKey: item.contentKey,\n value: override ? override.value : item.value,\n defaultValue: item.value,\n metadata: override?.metadata || item.metadata || {},\n };\n }\n }\n\n return {\n pageKey: defaults.pageKey,\n editable,\n contents,\n };\n}\n\nexport const getLandingPageContentCached = cache(\n async (pageKey: LandingPageKey) => getLandingPageContent(pageKey)\n);\n\nfunction isLandingPageKey(value: string): value is LandingPageKey {\n return value in pageDefaults;\n}\n\nexport function parseLandingContentName(name: string) {\n const [rawPageKey, rawSectionKey, ...contentParts] = name\n .split('.')\n .map((part) => part.trim());\n\n const pageKey = rawPageKey || '';\n const sectionKey = rawSectionKey || '';\n const contentKey = contentParts.join('.').trim();\n\n if (!isLandingPageKey(pageKey) || !sectionKey || !contentKey) {\n return null;\n }\n\n return {\n pageKey,\n sectionKey,\n contentKey,\n };\n}\n\nexport function getLandingContentItem(\n content: ResolvedLandingPageContent,\n sectionKey: string,\n contentKey: string\n) {\n const id = buildContentId(sectionKey, contentKey);\n const existing = content.contents[id];\n if (existing) {\n return existing;\n }\n\n return {\n pageKey: content.pageKey,\n sectionKey,\n contentKey,\n value: '',\n defaultValue: '',\n metadata: {},\n };\n}\n\nexport async function getLandingContentByName(name: LandingContentName) {\n const parsed = parseLandingContentName(name);\n\n if (!parsed) {\n return {\n editable: false,\n item: {\n pageKey: 'unknown',\n sectionKey: 'invalid',\n contentKey: name,\n value: '',\n defaultValue: '',\n metadata: {},\n } as ResolvedLandingContentItem,\n };\n }\n\n const content = await getLandingPageContentCached(parsed.pageKey);\n\n return {\n editable: content.editable,\n item: getLandingContentItem(content, parsed.sectionKey, parsed.contentKey),\n };\n}\n"],"mappings":";;;;;AA+CA,IAAIA,eAAqE,EAAE;AAE3E,SAAgB,uBACd,UACA;AACA,gBAAe;EACb,GAAG;EACH,GAAG;EACJ;;AAGH,SAAgB,eAAe,YAAoB,YAAoB;AACrE,QAAO,GAAG,WAAW,GAAG;;AAG1B,SAAS,iBAAiB,SA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A;EACD;;AAGH,MAAa,8BAA8B,MACzC,OAAO,YAA4B,sBAAsB,QAAQ,CAClE;AAED,SAAS,iBAAiB,OAAwC;AAChE,QAAO,SAAS;;AAGlB,SAAgB,wBAAwB,MAAc;CACpD,MAAM,CAAC,YAAY,eAAe,GAAG,gBAAgB,KAClD,MAAM,IAAI,CACV,KAAK,SAAS,KAAK,MAAM,CAAC;CAE7B,MAAM,UAAU,cAAc;CAC9B,MAAM,aAAa,iBAAiB;CACpC,MAAM,aAAa,aAAa,KAAK,IAAI,CAAC,MAAM;AAEhD,KAAI,CAAC,iBAAiB,QAAQ,IAAI,CAAC,cAAc,CAAC,WAChD,QAAO;AAGT,QAAO;EACL;EACA;EACA;EACD;;AAGH,SAAgB,sBACd,SACA,YACA,YACA;CACA,MAAM,KAAK,eAAe,YAAY,WAAW;CACjD,MAAM,WAAW,QAAQ,SAAS;AAClC,KAAI,SACF,QAAO;AAGT,QAAO;EACL,SAAS,QAAQ;EACjB;EACA;EACA,OAAO;EACP,cAAc;EACd,UAAU,EAAE;EACb;;AAGH,eAAsB,wBAAwB,MAA0B;CACtE,MAAM,SAAS,wBAAwB,KAAK;AAE5C,KAAI,CAAC,OACH,QAAO;EACL,UAAU;EACV,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,YAAY;GACZ,OAAO;GACP,cAAc;GACd,UAAU,EAAE;GACb;EACF;CAGH,MAAM,UAAU,MAAM,4BAA4B,OAAO,QAAQ;AAEjE,QAAO;EACL,UAAU,QAAQ;EAClB,MAAM,sBAAsB,SAAS,OAAO,YAAY,OAAO,WAAW;EAC3E"}
1
+ {"version":3,"file":"landing-content.js","names":["pageDefaults: Record<LandingPageKey, LandingPageContentDefinition>"],"sources":["../../src/components/landing-text/landing-content.ts"],"sourcesContent":["import 'server-only';\n\nimport { cache } from 'react';\nimport { cookies } from 'next/headers';\n\nimport type {\n LandingContentName,\n LandingPageContentApiItem,\n LandingPageContentDefinition,\n LandingPageKey,\n ResolvedLandingContentItem,\n ResolvedLandingPageContent,\n} from './types';\n\ntype NextFetchInit = RequestInit & {\n next?: {\n tags?: string[];\n };\n};\n\nlet pageDefaults: Record<LandingPageKey, LandingPageContentDefinition> = {};\n\nexport function setLandingPageDefaults(\n defaults: Record<LandingPageKey, LandingPageContentDefinition>\n) {\n pageDefaults = {\n ...pageDefaults,\n ...defaults,\n };\n}\n\nexport function buildContentId(sectionKey: string, contentKey: string) {\n return `${sectionKey}.${contentKey}`;\n}\n\nfunction toApiUrl(path: string) {\n const baseUrl = String(process.env.NEXT_PUBLIC_BASE_URL || '').replace(\n /\\/$/,\n ''\n );\n return baseUrl ? `${baseUrl}${path}` : '';\n}\n\nasync function getEditableState() {\n const cookieStore = await cookies();\n return Boolean(\n cookieStore.get('token')?.value && cookieStore.get('organization')?.value\n );\n}\n\nasync function getLandingOverrides(\n pageKey: LandingPageKey\n): Promise<LandingPageContentApiItem[]> {\n const organizationId = process.env.NEXT_PUBLIC_ORGANIZATION_ID;\n const url = toApiUrl(\n `/public/landing-page-contents/?page_key=${encodeURIComponent(pageKey)}`\n );\n\n if (!organizationId || !url) {\n return [];\n }\n\n try {\n const response = await fetch(url, {\n headers: {\n 'X-Organization': organizationId,\n },\n next: {\n tags: ['landing-page-content', `landing-page-content-${pageKey}`],\n },\n } satisfies NextFetchInit);\n\n if (!response.ok) {\n return [];\n }\n\n return response.json();\n } catch {\n return [];\n }\n}\n\nexport async function getLandingPageContent(\n pageKey: LandingPageKey\n): Promise<ResolvedLandingPageContent> {\n const defaults = pageDefaults[pageKey] ?? {\n pageKey,\n sections: [],\n };\n\n const [editable, overrides] = await Promise.all([\n getEditableState(),\n getLandingOverrides(pageKey),\n ]);\n\n const byId = new Map<string, LandingPageContentApiItem>(\n overrides.map((item) => [\n buildContentId(item.section_key, item.content_key),\n item,\n ])\n );\n\n const contents = Object.fromEntries(\n defaults.sections.flatMap((section) =>\n section.contents.map((item) => {\n const id = buildContentId(section.sectionKey, item.contentKey);\n const override = byId.get(id);\n\n return [\n id,\n {\n pageKey: defaults.pageKey,\n sectionKey: section.sectionKey,\n contentKey: item.contentKey,\n value: override?.value ?? item.value,\n defaultValue: item.value,\n metadata: override?.metadata ?? item.metadata ?? {},\n },\n ] as const;\n })\n )\n );\n\n return {\n pageKey: defaults.pageKey,\n editable,\n contents,\n };\n}\n\nconst getLandingPageContentCached = cache(getLandingPageContent);\n\nexport function parseLandingContentName(name: string) {\n const [rawPageKey, rawSectionKey, ...contentParts] = name\n .split('.')\n .map((part) => part.trim());\n\n const pageKey = rawPageKey || '';\n const sectionKey = rawSectionKey || '';\n const contentKey = contentParts.join('.').trim();\n\n if (!pageDefaults[pageKey] || !sectionKey || !contentKey) {\n return null;\n }\n\n return {\n pageKey,\n sectionKey,\n contentKey,\n };\n}\n\nexport function getLandingContentItem(\n content: ResolvedLandingPageContent,\n sectionKey: string,\n contentKey: string\n) {\n return (\n content.contents[buildContentId(sectionKey, contentKey)] ?? {\n pageKey: content.pageKey,\n sectionKey,\n contentKey,\n value: '',\n defaultValue: '',\n metadata: {},\n }\n );\n}\n\nexport async function getLandingContentByName(name: LandingContentName) {\n const parsed = parseLandingContentName(name);\n\n if (!parsed) {\n return {\n editable: false,\n item: {\n pageKey: 'unknown',\n sectionKey: 'invalid',\n contentKey: name,\n value: '',\n defaultValue: '',\n metadata: {},\n } as ResolvedLandingContentItem,\n };\n }\n\n const content = await getLandingPageContentCached(parsed.pageKey);\n\n return {\n editable: content.editable,\n item: getLandingContentItem(content, parsed.sectionKey, parsed.contentKey),\n };\n}\n"],"mappings":";;;;;AAoBA,IAAIA,eAAqE,EAAE;AAE3E,SAAgB,uBACd,UACA;AACA,gBAAe;EACb,GAAG;EACH,GAAG;EACJ;;AAGH,SAAgB,eAAe,YAAoB,YAAoB;AACrE,QAAO,GAAG,WAAW,GAAG;;AAG1B,SAAS,SAAS,MAAc;CAC9B,MAAM,UAAU,OAAO,QAAQ,IAAI,wBAAwB,GAAG,CAAC,QAC7D,OACA,GACD;AACD,QAAO,UA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AClB;EACA;EACD;;AAGH,MAAM,8BAA8B,MAAM,sBAAsB;AAEhE,SAAgB,wBAAwB,MAAc;CACpD,MAAM,CAAC,YAAY,eAAe,GAAG,gBAAgB,KAClD,MAAM,IAAI,CACV,KAAK,SAAS,KAAK,MAAM,CAAC;CAE7B,MAAM,UAAU,cAAc;CAC9B,MAAM,aAAa,iBAAiB;CACpC,MAAM,aAAa,aAAa,KAAK,IAAI,CAAC,MAAM;AAEhD,KAAI,CAAC,aAAa,YAAY,CAAC,cAAc,CAAC,WAC5C,QAAO;AAGT,QAAO;EACL;EACA;EACA;EACD;;AAGH,SAAgB,sBACd,SACA,YACA,YACA;AACA,QACE,QAAQ,SAAS,eAAe,YAAY,WAAW,KAAK;EAC1D,SAAS,QAAQ;EACjB;EACA;EACA,OAAO;EACP,cAAc;EACd,UAAU,EAAE;EACb;;AAIL,eAAsB,wBAAwB,MAA0B;CACtE,MAAM,SAAS,wBAAwB,KAAK;AAE5C,KAAI,CAAC,OACH,QAAO;EACL,UAAU;EACV,MAAM;GACJ,SAAS;GACT,YAAY;GACZ,YAAY;GACZ,OAAO;GACP,cAAc;GACd,UAAU,EAAE;GACb;EACF;CAGH,MAAM,UAAU,MAAM,4BAA4B,OAAO,QAAQ;AAEjE,QAAO;EACL,UAAU,QAAQ;EAClB,MAAM,sBAAsB,SAAS,OAAO,YAAY,OAAO,WAAW;EAC3E"}
@@ -1,26 +1,8 @@
1
- import { LandingContentName } from "./landing-content.js";
2
- import { LandingTextRegistration } from "./server-landing-text.js";
3
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import { LandingTextProps } from "./types.js";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
4
3
 
5
4
  //#region src/components/landing-text/landing-text.d.ts
6
- interface LandingTextItem extends LandingTextRegistration {
7
- value: string;
8
- defaultValue: string;
9
- metadata: Record<string, unknown>;
10
- }
11
- interface LandingTextBaseProps {
12
- className?: string;
13
- as?: 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'div';
14
- }
15
- interface LandingTextWithItemProps extends LandingTextBaseProps {
16
- item: LandingTextItem;
17
- editable: boolean;
18
- }
19
- interface LandingTextWithNameProps extends LandingTextBaseProps {
20
- name: LandingContentName;
21
- }
22
- type LandingTextProps = LandingTextWithItemProps | LandingTextWithNameProps;
23
- declare function LandingText(props: LandingTextProps): Promise<react_jsx_runtime1.JSX.Element>;
5
+ declare function LandingText(props: LandingTextProps): Promise<react_jsx_runtime10.JSX.Element>;
24
6
  //#endregion
25
- export { LandingText, LandingTextItem, LandingTextProps };
7
+ export { LandingText };
26
8
  //# sourceMappingURL=landing-text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"landing-text.d.ts","names":[],"sources":["../../src/components/landing-text/landing-text.tsx"],"sourcesContent":[],"mappings":";;;;;UAUiB,eAAA,SAAwB;;;EAAxB,QAAA,EAGL,MAHK,CAAA,MAAgB,EAAA,OAGrB,CAAA;AACX;AAOD,UALU,oBAAA,CAKgC;EAKzB,SAAA,CAAA,EAAA,MAAA;EAIL,EAAA,CAAA,EAAA,GAAA,GAAA,MAAA,GAAgB,IAAA,GAAA,IACxB,GAAA,IAAA,GAAA,KAAA;AACyB;AAQK,UAnBjB,wBAAA,SAAiC,oBAmBhB,CAAA;EAAgB,IAAA,EAlB1C,eAkB0C;EAAA,QAAA,EAAA,OAAA;;UAdjC,wBAAA,SAAiC;QAC1C;;KAGI,gBAAA,GACR,2BACA;iBAQW,WAAA,QAAmB,mBAAgB,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"landing-text.d.ts","names":[],"sources":["../../src/components/landing-text/landing-text.tsx"],"sourcesContent":[],"mappings":";;;;iBAWe,WAAA,QAAmB,mBAAgB,QAAA,mBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"landing-text.js","names":[],"sources":["../../src/components/landing-text/landing-text.tsx"],"sourcesContent":["import { ClientLandingText } from './client-landing-text';\nimport {\n getLandingContentByName,\n type LandingContentName,\n} from './landing-content';\nimport {\n type LandingTextRegistration,\n ServerLandingText,\n} from './server-landing-text';\n\nexport interface LandingTextItem extends LandingTextRegistration {\n value: string;\n defaultValue: string;\n metadata: Record<string, unknown>;\n}\n\ninterface LandingTextBaseProps {\n className?: string;\n as?: 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'div';\n}\n\nexport interface LandingTextWithItemProps extends LandingTextBaseProps {\n item: LandingTextItem;\n editable: boolean;\n}\n\nexport interface LandingTextWithNameProps extends LandingTextBaseProps {\n name: LandingContentName;\n}\n\nexport type LandingTextProps =\n | LandingTextWithItemProps\n | LandingTextWithNameProps;\n\nfunction isLandingTextWithName(\n props: LandingTextProps\n): props is LandingTextWithNameProps {\n return 'name' in props;\n}\n\nasync function LandingText(props: LandingTextProps) {\n const { className, as } = props;\n\n const { item, editable } = isLandingTextWithName(props)\n ? await getLandingContentByName(props.name)\n : {\n item: props.item,\n editable: props.editable,\n };\n\n return (\n <ClientLandingText editable={editable} item={item}>\n <ServerLandingText\n as={as}\n className={className}\n registration={{\n pageKey: item.pageKey,\n sectionKey: item.sectionKey,\n contentKey: item.contentKey,\n }}\n value={item.value}\n />\n </ClientLandingText>\n );\n}\n\nexport { LandingText };\n"],"mappings":";;;;;;AAkCA,SAAS,sBACP,OACmC;AACnC,QAAO,UAAU;;AAGnB,eAAe,YAAY,OAAyB;CAClD,MAAM,EAAE,WAAW,OAAO;CAE1B,MAAM,EAAE,MAAM,aAAa,sBAAsB,MAAM,GACnD,MAAM,wBAAwB,MAAM,KAAK,GACzC;EACE,MAAM,MAAM;EACZ,UAAU,MAAM;EACjB;AAEL,QACE,oBAAC;EAA4B;EAAgB;YAC3C,oBAAC;GACK;GACO;GACX,cAAc;IACZ,SAAS,KAAK;IACd,YAAY,KAAK;IACjB,YAAY,KAAK;IAClB;GACD,OAAO,KAAK;IACZ;GACgB"}
1
+ {"version":3,"file":"landing-text.js","names":[],"sources":["../../src/components/landing-text/landing-text.tsx"],"sourcesContent":["import { ClientLandingText } from './client-landing-text';\nimport { getLandingContentByName } from './landing-content';\nimport { ServerLandingText } from './server-landing-text';\nimport type { LandingTextProps, LandingTextWithNameProps } from './types';\n\nfunction isLandingTextWithName(\n props: LandingTextProps\n): props is LandingTextWithNameProps {\n return 'name' in props;\n}\n\nasync function LandingText(props: LandingTextProps) {\n const { className, as } = props;\n\n const { item, editable } = isLandingTextWithName(props)\n ? await getLandingContentByName(props.name)\n : {\n item: props.item,\n editable: props.editable,\n };\n\n return (\n <ClientLandingText editable={editable} item={item}>\n <ServerLandingText\n as={as}\n className={className}\n registration={{\n pageKey: item.pageKey,\n sectionKey: item.sectionKey,\n contentKey: item.contentKey,\n }}\n value={item.value}\n />\n </ClientLandingText>\n );\n}\n\nexport { LandingText };\n"],"mappings":";;;;;;AAKA,SAAS,sBACP,OACmC;AACnC,QAAO,UAAU;;AAGnB,eAAe,YAAY,OAAyB;CAClD,MAAM,EAAE,WAAW,OAAO;CAE1B,MAAM,EAAE,MAAM,aAAa,sBAAsB,MAAM,GACnD,MAAM,wBAAwB,MAAM,KAAK,GACzC;EACE,MAAM,MAAM;EACZ,UAAU,MAAM;EACjB;AAEL,QACE,oBAAC;EAA4B;EAAgB;YAC3C,oBAAC;GACK;GACO;GACX,cAAc;IACZ,SAAS,KAAK;IACd,YAAY,KAAK;IACjB,YAAY,KAAK;IAClB;GACD,OAAO,KAAK;IACZ;GACgB"}
@@ -1,24 +1,14 @@
1
- import { ElementType, HTMLAttributes } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import { ServerLandingTextProps } from "./types.js";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/landing-text/server-landing-text.d.ts
5
- interface LandingTextRegistration {
6
- pageKey: string;
7
- sectionKey: string;
8
- contentKey: string;
9
- }
10
- interface ServerLandingTextProps extends HTMLAttributes<HTMLElement> {
11
- as?: ElementType;
12
- value: string;
13
- registration?: LandingTextRegistration;
14
- }
15
5
  declare function ServerLandingText({
16
6
  as: As,
17
7
  value,
18
8
  className,
19
9
  registration,
20
10
  ...props
21
- }: ServerLandingTextProps): react_jsx_runtime0.JSX.Element;
11
+ }: ServerLandingTextProps): react_jsx_runtime5.JSX.Element;
22
12
  //#endregion
23
- export { LandingTextRegistration, ServerLandingText, ServerLandingTextProps };
13
+ export { ServerLandingText };
24
14
  //# sourceMappingURL=server-landing-text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-landing-text.d.ts","names":[],"sources":["../../src/components/landing-text/server-landing-text.tsx"],"sourcesContent":[],"mappings":";;;;UAIiB,uBAAA;;;EAAA,UAAA,EAAA,MAAA;AAMjB;AAA+D,UAA9C,sBAAA,SAA+B,cAAe,CAAA,WAAA,CAAA,CAAA;EACxD,EAAA,CAAA,EAAA,WAAA;EAEU,KAAA,EAAA,MAAA;EAH+B,YAAA,CAAA,EAG/B,uBAH+B;;AAI/C,iBAEQ,iBAAA,CAAiB;EAAA,EAAA,EACpB,EADoB;EAAA,KAAA;EAAA,SAAA;EAAA,YAAA;EAAA,GAAA;AAAA,CAAA,EAMvB,sBANuB,CAAA,EAMD,kBAAA,CAAA,GAAA,CAAA,OANC"}
1
+ {"version":3,"file":"server-landing-text.d.ts","names":[],"sources":["../../src/components/landing-text/server-landing-text.tsx"],"sourcesContent":[],"mappings":";;;;iBAGS,iBAAA;MACH;;;;;GAKH,yBAAsB,kBAAA,CAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"server-landing-text.js","names":[],"sources":["../../src/components/landing-text/server-landing-text.tsx"],"sourcesContent":["import type { ElementType, HTMLAttributes } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nexport interface LandingTextRegistration {\n pageKey: string;\n sectionKey: string;\n contentKey: string;\n}\n\nexport interface ServerLandingTextProps extends HTMLAttributes<HTMLElement> {\n as?: ElementType;\n value: string;\n registration?: LandingTextRegistration;\n}\n\nfunction ServerLandingText({\n as: As = 'span',\n value,\n className,\n registration,\n ...props\n}: ServerLandingTextProps) {\n return (\n <As\n className={cn(className)}\n data-content-key={registration?.contentKey}\n data-page-key={registration?.pageKey}\n data-section-key={registration?.sectionKey}\n {...props}\n >\n {value}\n </As>\n );\n}\n\nexport { ServerLandingText };\n"],"mappings":";;;;AAgBA,SAAS,kBAAkB,EACzB,IAAI,KAAK,QACT,OACA,WACA,aACA,GAAG,SACsB;AACzB,QACE,oBAAC;EACC,WAAW,GAAG,UAAU;EACxB,oBAAkB,cAAc;EAChC,iBAAe,cAAc;EAC7B,oBAAkB,cAAc;EAChC,GAAI;YAEH;GACE"}
1
+ {"version":3,"file":"server-landing-text.js","names":[],"sources":["../../src/components/landing-text/server-landing-text.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\nimport type { ServerLandingTextProps } from './types';\n\nfunction ServerLandingText({\n as: As = 'span',\n value,\n className,\n registration,\n ...props\n}: ServerLandingTextProps) {\n return (\n <As\n className={cn(className)}\n data-content-key={registration?.contentKey}\n data-page-key={registration?.pageKey}\n data-section-key={registration?.sectionKey}\n {...props}\n >\n {value}\n </As>\n );\n}\n\nexport { ServerLandingText };\n"],"mappings":";;;;AAGA,SAAS,kBAAkB,EACzB,IAAI,KAAK,QACT,OACA,WACA,aACA,GAAG,SACsB;AACzB,QACE,oBAAC;EACC,WAAW,GAAG,UAAU;EACxB,oBAAkB,cAAc;EAChC,iBAAe,cAAc;EAC7B,oBAAkB,cAAc;EAChC,GAAI;YAEH;GACE"}
@@ -0,0 +1,68 @@
1
+ import { ElementType, HTMLAttributes } from "react";
2
+
3
+ //#region src/components/landing-text/types.d.ts
4
+ type LandingPageKey = string;
5
+ type LandingContentName = `${string}.${string}.${string}`;
6
+ interface LandingContentDefinitionItem {
7
+ contentKey: string;
8
+ value: string;
9
+ metadata?: Record<string, unknown>;
10
+ }
11
+ interface LandingContentDefinitionSection {
12
+ sectionKey: string;
13
+ contents: LandingContentDefinitionItem[];
14
+ }
15
+ interface LandingPageContentDefinition {
16
+ pageKey: string;
17
+ sections: LandingContentDefinitionSection[];
18
+ }
19
+ interface LandingPageContentApiItem {
20
+ page_key: string;
21
+ section_key: string;
22
+ content_key: string;
23
+ value: string;
24
+ metadata?: Record<string, unknown>;
25
+ }
26
+ interface ResolvedLandingContentItem {
27
+ pageKey: string;
28
+ sectionKey: string;
29
+ contentKey: string;
30
+ value: string;
31
+ defaultValue: string;
32
+ metadata: Record<string, unknown>;
33
+ }
34
+ interface ResolvedLandingPageContent {
35
+ pageKey: string;
36
+ editable: boolean;
37
+ contents: Record<string, ResolvedLandingContentItem>;
38
+ }
39
+ interface LandingTextRegistration {
40
+ pageKey: string;
41
+ sectionKey: string;
42
+ contentKey: string;
43
+ }
44
+ interface LandingTextItem extends LandingTextRegistration {
45
+ value: string;
46
+ defaultValue: string;
47
+ metadata: Record<string, unknown>;
48
+ }
49
+ interface LandingTextBaseProps {
50
+ className?: string;
51
+ as?: 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'div';
52
+ }
53
+ interface LandingTextWithItemProps extends LandingTextBaseProps {
54
+ item: LandingTextItem;
55
+ editable: boolean;
56
+ }
57
+ interface LandingTextWithNameProps extends LandingTextBaseProps {
58
+ name: LandingContentName;
59
+ }
60
+ type LandingTextProps = LandingTextWithItemProps | LandingTextWithNameProps;
61
+ interface ServerLandingTextProps extends HTMLAttributes<HTMLElement> {
62
+ as?: ElementType;
63
+ value: string;
64
+ registration?: LandingTextRegistration;
65
+ }
66
+ //#endregion
67
+ export { LandingContentDefinitionItem, LandingContentDefinitionSection, LandingContentName, LandingPageContentApiItem, LandingPageContentDefinition, LandingPageKey, LandingTextItem, LandingTextProps, LandingTextRegistration, ResolvedLandingContentItem, ResolvedLandingPageContent, ServerLandingTextProps };
68
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/components/landing-text/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,cAAA;KACA,kBAAA;AADA,UAGK,4BAAA,CAHS;EACd,UAAA,EAAA,MAAA;EAEK,KAAA,EAAA,MAAA;EAMA,QAAA,CAAA,EAHJ,MAGI,CAAA,MAAA,EAAA,OAAA,CAA+B;AAKhD;AAKiB,UAVA,+BAAA,CAeJ;EAGI,UAAA,EAAA,MAAA;EASA,QAAA,EAzBL,4BAyB+B,EAAA;AAM3C;AAMiB,UAlCA,4BAAA,CAkCwB;EAMxB,OAAA,EAAA,MAAA;EAKA,QAAA,EA3CL,+BA4CJ,EAAA;AAIR;AAIY,UAjDK,yBAAA,CAkDb;EAGa,QAAA,EAAA,MAAA;EAA8C,WAAA,EAAA,MAAA;EACxD,WAAA,EAAA,MAAA;EAEU,KAAA,EAAA,MAAA;EAH+B,QAAA,CAAA,EAhDnC,MAgDmC,CAAA,MAAA,EAAA,OAAA,CAAA;;UA7C/B,0BAAA;;;;;;YAML;;UAGK,0BAAA;;;YAGL,eAAe;;UAGV,uBAAA;;;;;UAMA,eAAA,SAAwB;;;YAG7B;;UAGK,oBAAA;;;;UAKA,wBAAA,SAAiC;QAC1C;;;UAIS,wBAAA,SAAiC;QAC1C;;KAGI,gBAAA,GACR,2BACA;UAEa,sBAAA,SAA+B,eAAe;OACxD;;iBAEU"}
@@ -1,3 +1,4 @@
1
- import { LandingTextRegistration, ServerLandingText, ServerLandingTextProps } from "./landing-text/server-landing-text.js";
2
- import { LandingText, LandingTextItem, LandingTextProps } from "./landing-text/landing-text.js";
1
+ import { LandingTextItem, LandingTextProps, LandingTextRegistration, ServerLandingTextProps } from "./landing-text/types.js";
2
+ import { LandingText } from "./landing-text/landing-text.js";
3
+ import { ServerLandingText } from "./landing-text/server-landing-text.js";
3
4
  export { LandingText, type LandingTextItem, type LandingTextProps, type LandingTextRegistration, ServerLandingText, type ServerLandingTextProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/page-header/page-header.d.ts
4
4
  interface PageHeaderProps {
@@ -10,7 +10,7 @@ declare function PageHeader({
10
10
  title,
11
11
  help,
12
12
  description
13
- }: PageHeaderProps): react_jsx_runtime5.JSX.Element;
13
+ }: PageHeaderProps): react_jsx_runtime0.JSX.Element;
14
14
  //#endregion
15
15
  export { PageHeader, PageHeaderProps };
16
16
  //# sourceMappingURL=page-header.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { SelectorProps } from "../ui/selector.js";
2
2
  import { FieldPath, FieldPathValue, FieldValues, UseControllerProps } from "react-hook-form";
3
- import * as react_jsx_runtime10 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
4
4
  import { Options } from "nuqs";
5
5
 
6
6
  //#region src/components/remote-selector/remote-selector.d.ts
@@ -38,7 +38,7 @@ declare function RemoteSelectorField<T, TFieldValues extends FieldValues = Field
38
38
  ...props
39
39
  }: RemoteSelectorFieldProps<TFieldValues, TFieldName> & BaseRemoteSelectorProps<T> & {
40
40
  withPortal?: boolean;
41
- }): react_jsx_runtime10.JSX.Element;
41
+ }): react_jsx_runtime3.JSX.Element;
42
42
  interface RemoteSelectorQueryProps<T> extends BaseRemoteSelectorProps<T> {
43
43
  name: string;
44
44
  defaultValue?: string;
@@ -58,7 +58,7 @@ declare function RemoteSelectorQuery<T>({
58
58
  fieldLabel,
59
59
  type,
60
60
  ...props
61
- }: RemoteSelectorQueryProps<T>): react_jsx_runtime10.JSX.Element;
61
+ }: RemoteSelectorQueryProps<T>): react_jsx_runtime3.JSX.Element;
62
62
  //#endregion
63
63
  export { BaseRemoteSelectorProps, RemoteSelectorField, RemoteSelectorFieldProps, RemoteSelectorQuery, RemoteSelectorQueryProps, TUseData };
64
64
  //# sourceMappingURL=remote-selector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remote-selector.d.ts","names":[],"sources":["../../src/components/remote-selector/remote-selector.tsx"],"sourcesContent":[],"mappings":";;;;;;KAwBY;QAKJ;;EALI,OAAA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AAA,EAqGR,CArGQ,GAqGJ,CArGI,EAAA,GAAA,IAAA,EAAA,GAAA,IAAA;;AAJD,iBA4GZ,mBA5GY,CAAA,CAAA,CAAA,CAAA;EAAA,IAAA;EAAA,YAAA;EAAA,OAAA;EAAA,OAAA;EAAA,aAAA;EAAA,cAAA;EAAA,WAAA;EAAA,QAAA,EAoHhB,gBApHgB;EAAA,QAAA;EAAA,UAAA;EAAA,IAAA;EAAA,GAAA;AAAA,CAAA,EAyHzB,wBAzHyB,CAyHA,CAzHA,CAAA,CAAA,EAyHE,kBAAA,CAAA,GAAA,CAAA,OAzHF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maquinaweb-ui",
3
- "version": "2.65.1",
3
+ "version": "2.66.0",
4
4
  "description": "A minimal React component library",
5
5
  "type": "module",
6
6
  "sideEffects": false,