@webiny/app-website-builder 6.4.8 → 6.4.9

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.
@@ -87,8 +87,7 @@ const BackgroundImage = observer(({ elementId })=>{
87
87
  type: "compact",
88
88
  value: pickerValue,
89
89
  onSelectItem: ()=>showFileManager(),
90
- onRemoveItem: onRemove,
91
- onEditItem: ()=>showFileManager()
90
+ onRemoveItem: onRemove
92
91
  })
93
92
  }));
94
93
  });
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.tsx"],"sourcesContent":["import React, { useEffect, useState, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { FileManager, type FileManagerFileItem } from \"@webiny/app-admin\";\nimport { FilePicker } from \"@webiny/admin-ui\";\nimport { useStyles } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/useStyles.js\";\nimport { BackgroundImageParser } from \"./BackgroundImageParser.js\";\nimport { useBreakpoint } from \"~/BaseEditor/hooks/useBreakpoint.js\";\nimport { InheritanceLabel } from \"../../../InheritanceLabel.js\";\nimport { SidebarRow } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js\";\n\ntype FileInfo = {\n id: string;\n name: string;\n size: number;\n type: string;\n url: string;\n};\n\nconst DEFAULT_POSITION = \"center\";\nconst DEFAULT_SCALING = {\n backgroundSize: \"cover\",\n backgroundRepeat: \"no-repeat\"\n};\n\nexport const parseValue = (value: string) => {\n if (!value) {\n return undefined;\n }\n\n return;\n};\n\nexport const BackgroundImage = observer(({ elementId }: { elementId: string }) => {\n const { isBaseBreakpoint } = useBreakpoint();\n const { styles, metadata, onChange, inheritanceMap } = useStyles(elementId);\n const [localValue, setLocalValue] = useState<string | null>(styles.backgroundImage);\n const url = useMemo(() => {\n const parser = new BackgroundImageParser(styles.backgroundImage);\n const rules = parser.getRules();\n const urlRule = rules.find(r => r.type === \"url\");\n if (urlRule && urlRule.type === \"url\") {\n return urlRule.parsed.url;\n }\n return null;\n }, [styles.backgroundImage]);\n\n useEffect(() => {\n if (styles.backgroundImage !== localValue) {\n setLocalValue(styles.backgroundImage);\n }\n }, [styles.backgroundImage]);\n\n const onFileChange = (file: FileManagerFileItem) => {\n onChange(({ styles, metadata }) => {\n styles.set(\"backgroundPosition\", DEFAULT_POSITION);\n styles.set(\"backgroundSize\", DEFAULT_SCALING.backgroundSize);\n styles.set(\"backgroundRepeat\", DEFAULT_SCALING.backgroundRepeat);\n styles.set(\"backgroundImage\", `url(\"${file.src}\")`);\n\n metadata.set(\"backgroundImage\", {\n id: file.id,\n name: file.name,\n size: file.size,\n type: file.type,\n url: file.src || \"\"\n });\n });\n };\n\n const onRemove = () => {\n onChange(({ styles, metadata }) => {\n // On base breakpoint, we unset the image and all styles related to it.\n if (isBaseBreakpoint) {\n styles.unset(\"backgroundImage\");\n styles.unset(\"backgroundPosition\");\n styles.unset(\"backgroundSize\");\n styles.unset(\"backgroundRepeat\");\n } else {\n styles.set(\"backgroundImage\", \"none\");\n }\n\n metadata.unset(\"backgroundImage\");\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"backgroundImage\");\n\n metadata.unset(\"backgroundImage\");\n });\n };\n\n const inheritance = inheritanceMap?.backgroundImage ?? {};\n\n const fileInfo = metadata.get<FileInfo>(\"backgroundImage\");\n\n // The FilePicker expects a FileItemDto (`mimeType`, `src`), but our metadata stores the\n // legacy shape (`type`, `url`). Map it across so the picker can detect an image and render\n // the thumbnail (otherwise `mimeType` is undefined and it shows the generic file icon).\n const pickerValue =\n url && fileInfo\n ? {\n id: fileInfo.id,\n name: fileInfo.name,\n size: fileInfo.size,\n mimeType: fileInfo.type,\n src: fileInfo.url\n }\n : undefined;\n\n return (\n <SidebarRow\n label={\n <InheritanceLabel\n onReset={onReset}\n isOverridden={inheritance?.overridden ?? false}\n inheritedFrom={inheritance?.inheritedFrom}\n text={\"Image\"}\n />\n }\n >\n <FileManager\n images={true}\n onChange={onFileChange}\n render={({ showFileManager }) => (\n <FilePicker\n variant={\"secondary\"}\n type=\"compact\"\n value={pickerValue}\n onSelectItem={() => showFileManager()}\n onRemoveItem={onRemove}\n onEditItem={() => showFileManager()}\n />\n )}\n />\n </SidebarRow>\n );\n});\n"],"names":["DEFAULT_POSITION","DEFAULT_SCALING","parseValue","value","BackgroundImage","observer","elementId","isBaseBreakpoint","useBreakpoint","styles","metadata","onChange","inheritanceMap","useStyles","localValue","setLocalValue","useState","url","useMemo","parser","BackgroundImageParser","rules","urlRule","r","useEffect","onFileChange","file","onRemove","onReset","inheritance","fileInfo","pickerValue","undefined","SidebarRow","InheritanceLabel","FileManager","showFileManager","FilePicker"],"mappings":";;;;;;;;;AAkBA,MAAMA,mBAAmB;AACzB,MAAMC,kBAAkB;IACpB,gBAAgB;IAChB,kBAAkB;AACtB;AAEO,MAAMC,aAAa,CAACC,SAM3B;AAEO,MAAMC,kBAAkBC,SAAS,CAAC,EAAEC,SAAS,EAAyB;IACzE,MAAM,EAAEC,gBAAgB,EAAE,GAAGC;IAC7B,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,cAAc,EAAE,GAAGC,UAAUP;IACjE,MAAM,CAACQ,YAAYC,cAAc,GAAGC,SAAwBP,OAAO,eAAe;IAClF,MAAMQ,MAAMC,QAAQ;QAChB,MAAMC,SAAS,IAAIC,sBAAsBX,OAAO,eAAe;QAC/D,MAAMY,QAAQF,OAAO,QAAQ;QAC7B,MAAMG,UAAUD,MAAM,IAAI,CAACE,CAAAA,IAAKA,AAAW,UAAXA,EAAE,IAAI;QACtC,IAAID,WAAWA,AAAiB,UAAjBA,QAAQ,IAAI,EACvB,OAAOA,QAAQ,MAAM,CAAC,GAAG;QAE7B,OAAO;IACX,GAAG;QAACb,OAAO,eAAe;KAAC;I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,SAAS,GAAG;IACrB,IACAE;IAEV,OAAO,WAAP,GACI,oBAACC,YAAUA;QACP,qBACI,oBAACC,kBAAgBA;YACb,SAASN;YACT,cAAcC,aAAa,cAAc;YACzC,eAAeA,aAAa;YAC5B,MAAM;;qBAId,oBAACM,aAAWA;QACR,QAAQ;QACR,UAAUV;QACV,QAAQ,CAAC,EAAEW,eAAe,EAAE,iBACxB,oBAACC,YAAUA;gBACP,SAAS;gBACT,MAAK;gBACL,OAAON;gBACP,cAAc,IAAMK;gBACpB,cAAcT;gBACd,YAAY,IAAMS;;;AAM1C"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.tsx"],"sourcesContent":["import React, { useEffect, useState, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { FileManager, type FileManagerFileItem } from \"@webiny/app-admin\";\nimport { FilePicker } from \"@webiny/admin-ui\";\nimport { useStyles } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/useStyles.js\";\nimport { BackgroundImageParser } from \"./BackgroundImageParser.js\";\nimport { useBreakpoint } from \"~/BaseEditor/hooks/useBreakpoint.js\";\nimport { InheritanceLabel } from \"../../../InheritanceLabel.js\";\nimport { SidebarRow } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js\";\n\ntype FileInfo = {\n id: string;\n name: string;\n size: number;\n type: string;\n url: string;\n};\n\nconst DEFAULT_POSITION = \"center\";\nconst DEFAULT_SCALING = {\n backgroundSize: \"cover\",\n backgroundRepeat: \"no-repeat\"\n};\n\nexport const parseValue = (value: string) => {\n if (!value) {\n return undefined;\n }\n\n return;\n};\n\nexport const BackgroundImage = observer(({ elementId }: { elementId: string }) => {\n const { isBaseBreakpoint } = useBreakpoint();\n const { styles, metadata, onChange, inheritanceMap } = useStyles(elementId);\n const [localValue, setLocalValue] = useState<string | null>(styles.backgroundImage);\n const url = useMemo(() => {\n const parser = new BackgroundImageParser(styles.backgroundImage);\n const rules = parser.getRules();\n const urlRule = rules.find(r => r.type === \"url\");\n if (urlRule && urlRule.type === \"url\") {\n return urlRule.parsed.url;\n }\n return null;\n }, [styles.backgroundImage]);\n\n useEffect(() => {\n if (styles.backgroundImage !== localValue) {\n setLocalValue(styles.backgroundImage);\n }\n }, [styles.backgroundImage]);\n\n const onFileChange = (file: FileManagerFileItem) => {\n onChange(({ styles, metadata }) => {\n styles.set(\"backgroundPosition\", DEFAULT_POSITION);\n styles.set(\"backgroundSize\", DEFAULT_SCALING.backgroundSize);\n styles.set(\"backgroundRepeat\", DEFAULT_SCALING.backgroundRepeat);\n styles.set(\"backgroundImage\", `url(\"${file.src}\")`);\n\n metadata.set(\"backgroundImage\", {\n id: file.id,\n name: file.name,\n size: file.size,\n type: file.type,\n url: file.src || \"\"\n });\n });\n };\n\n const onRemove = () => {\n onChange(({ styles, metadata }) => {\n // On base breakpoint, we unset the image and all styles related to it.\n if (isBaseBreakpoint) {\n styles.unset(\"backgroundImage\");\n styles.unset(\"backgroundPosition\");\n styles.unset(\"backgroundSize\");\n styles.unset(\"backgroundRepeat\");\n } else {\n styles.set(\"backgroundImage\", \"none\");\n }\n\n metadata.unset(\"backgroundImage\");\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"backgroundImage\");\n\n metadata.unset(\"backgroundImage\");\n });\n };\n\n const inheritance = inheritanceMap?.backgroundImage ?? {};\n\n const fileInfo = metadata.get<FileInfo>(\"backgroundImage\");\n\n // The FilePicker expects a FileItemDto (`mimeType`, `src`), but our metadata stores the\n // legacy shape (`type`, `url`). Map it across so the picker can detect an image and render\n // the thumbnail (otherwise `mimeType` is undefined and it shows the generic file icon).\n const pickerValue =\n url && fileInfo\n ? {\n id: fileInfo.id,\n name: fileInfo.name,\n size: fileInfo.size,\n mimeType: fileInfo.type,\n src: fileInfo.url\n }\n : undefined;\n\n return (\n <SidebarRow\n label={\n <InheritanceLabel\n onReset={onReset}\n isOverridden={inheritance?.overridden ?? false}\n inheritedFrom={inheritance?.inheritedFrom}\n text={\"Image\"}\n />\n }\n >\n <FileManager\n images={true}\n onChange={onFileChange}\n render={({ showFileManager }) => (\n <FilePicker\n variant={\"secondary\"}\n type=\"compact\"\n value={pickerValue}\n onSelectItem={() => showFileManager()}\n onRemoveItem={onRemove}\n />\n )}\n />\n </SidebarRow>\n );\n});\n"],"names":["DEFAULT_POSITION","DEFAULT_SCALING","parseValue","value","BackgroundImage","observer","elementId","isBaseBreakpoint","useBreakpoint","styles","metadata","onChange","inheritanceMap","useStyles","localValue","setLocalValue","useState","url","useMemo","parser","BackgroundImageParser","rules","urlRule","r","useEffect","onFileChange","file","onRemove","onReset","inheritance","fileInfo","pickerValue","undefined","SidebarRow","InheritanceLabel","FileManager","showFileManager","FilePicker"],"mappings":";;;;;;;;;AAkBA,MAAMA,mBAAmB;AACzB,MAAMC,kBAAkB;IACpB,gBAAgB;IAChB,kBAAkB;AACtB;AAEO,MAAMC,aAAa,CAACC,SAM3B;AAEO,MAAMC,kBAAkBC,SAAS,CAAC,EAAEC,SAAS,EAAyB;IACzE,MAAM,EAAEC,gBAAgB,EAAE,GAAGC;IAC7B,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,cAAc,EAAE,GAAGC,UAAUP;IACjE,MAAM,CAACQ,YAAYC,cAAc,GAAGC,SAAwBP,OAAO,eAAe;IAClF,MAAMQ,MAAMC,QAAQ;QAChB,MAAMC,SAAS,IAAIC,sBAAsBX,OAAO,eAAe;QAC/D,MAAMY,QAAQF,OAAO,QAAQ;QAC7B,MAAMG,UAAUD,MAAM,IAAI,CAACE,CAAAA,IAAKA,AAAW,UAAXA,EAAE,IAAI;QACtC,IAAID,WAAWA,AAAiB,UAAjBA,QAAQ,IAAI,EACvB,OAAOA,QAAQ,MAAM,CAAC,GAAG;QAE7B,OAAO;IACX,GAAG;QAACb,O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IAAI;QACvB,KAAKA,SAAS,GAAG;IACrB,IACAE;IAEV,OAAO,WAAP,GACI,oBAACC,YAAUA;QACP,qBACI,oBAACC,kBAAgBA;YACb,SAASN;YACT,cAAcC,aAAa,cAAc;YACzC,eAAeA,aAAa;YAC5B,MAAM;;qBAId,oBAACM,aAAWA;QACR,QAAQ;QACR,UAAUV;QACV,QAAQ,CAAC,EAAEW,eAAe,EAAE,iBACxB,oBAACC,YAAUA;gBACP,SAAS;gBACT,MAAK;gBACL,OAAON;gBACP,cAAc,IAAMK;gBACpB,cAAcT;;;AAMtC"}
@@ -2,9 +2,9 @@ import react from "react";
2
2
  import { Icon, Tooltip } from "@webiny/admin-ui";
3
3
  import { ReactComponent } from "@webiny/icons/info.svg";
4
4
  const SidebarRow = ({ label, tooltip, children })=>/*#__PURE__*/ react.createElement("div", {
5
- className: "flex items-center gap-xxs"
5
+ className: "flex items-start gap-xxs"
6
6
  }, /*#__PURE__*/ react.createElement("div", {
7
- className: "w-[80px] flex flex-row items-center gap-xxs shrink-0 text-sm text-neutral-strong"
7
+ className: "w-[80px] pt-sm flex flex-row items-center gap-xxs shrink-0 text-sm text-neutral-strong"
8
8
  }, label, tooltip ? /*#__PURE__*/ react.createElement(Tooltip, {
9
9
  trigger: /*#__PURE__*/ react.createElement(Icon, {
10
10
  icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
@@ -1 +1 @@
1
- {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as InfoIcon } from \"@webiny/icons/info.svg\";\n\ninterface SidebarRowProps {\n label: React.ReactNode;\n tooltip?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport const SidebarRow = ({ label, tooltip, children }: SidebarRowProps) => {\n return (\n <div className={\"flex items-center gap-xxs\"}>\n <div\n className={\n \"w-[80px] flex flex-row items-center gap-xxs shrink-0 text-sm text-neutral-strong\"\n }\n >\n {label}\n\n {tooltip ? (\n <Tooltip\n trigger={\n <Icon\n icon={<InfoIcon />}\n size={\"xs\"}\n label={\"More information\"}\n color={\"neutral-light\"}\n />\n }\n content={tooltip}\n side={\"left\"}\n />\n ) : (\n <div className={\"w-xs shrink-0\"} />\n )}\n </div>\n {/* min-w-0 lets the cell shrink below its content's intrinsic width, so long\n unbroken values (e.g. a hashed file name) truncate instead of widening the\n row and pushing controls past the sidebar edge. */}\n <div className={\"flex-1 min-w-0\"}>{children}</div>\n </div>\n );\n};\n"],"names":["SidebarRow","label","tooltip","children","Tooltip","Icon","InfoIcon"],"mappings":";;;AAUO,MAAMA,aAAa,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEC,QAAQ,EAAmB,GAC7D,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QACG,WACI;OAGHF,OAEAC,UAAU,WAAVA,GACG,oBAACE,SAAOA;QACJ,uBACI,oBAACC,MAAIA;YACD,oBAAM,oBAACC,gBAAQA;YACf,MAAM;YACN,OAAO;YACP,OAAO;;QAGf,SAASJ;QACT,MAAM;uBAGV,oBAAC;QAAI,WAAW;uBAMxB,oBAAC;QAAI,WAAW;OAAmBC"}
1
+ {"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js","sources":["../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon, Tooltip } from \"@webiny/admin-ui\";\nimport { ReactComponent as InfoIcon } from \"@webiny/icons/info.svg\";\n\ninterface SidebarRowProps {\n label: React.ReactNode;\n tooltip?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport const SidebarRow = ({ label, tooltip, children }: SidebarRowProps) => {\n return (\n // The label sits at the top of the row rather than centered against the value, so that a\n // row is free to render something taller than one control - the file picker's stacked\n // preview, say - without the label drifting to the middle of it.\n <div className={\"flex items-start gap-xxs\"}>\n {/* `pt-sm` is half the difference between a standard control (a `size=\"md\"` Select is\n 32px) and this label's 16px line, which puts the label exactly where centering\n would for the ordinary single-control row, and leaves it there for taller ones. */}\n <div\n className={\n \"w-[80px] pt-sm flex flex-row items-center gap-xxs shrink-0 text-sm text-neutral-strong\"\n }\n >\n {label}\n\n {tooltip ? (\n <Tooltip\n trigger={\n <Icon\n icon={<InfoIcon />}\n size={\"xs\"}\n label={\"More information\"}\n color={\"neutral-light\"}\n />\n }\n content={tooltip}\n side={\"left\"}\n />\n ) : (\n <div className={\"w-xs shrink-0\"} />\n )}\n </div>\n {/* min-w-0 lets the cell shrink below its content's intrinsic width, so long\n unbroken values (e.g. a hashed file name) truncate instead of widening the\n row and pushing controls past the sidebar edge. */}\n <div className={\"flex-1 min-w-0\"}>{children}</div>\n </div>\n );\n};\n"],"names":["SidebarRow","label","tooltip","children","Tooltip","Icon","InfoIcon"],"mappings":";;;AAUO,MAAMA,aAAa,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEC,QAAQ,EAAmB,G,cAKhE,oBAAC;QAAI,WAAW;qBAIZ,oBAAC;QACG,WACI;OAGHF,OAEAC,UAAU,WAAVA,GACG,oBAACE,SAAOA;QACJ,uBACI,oBAACC,MAAIA;YACD,oBAAM,oBAACC,gBAAQA;YACf,MAAM;YACN,OAAO;YACP,OAAO;;QAGf,SAASJ;QACT,MAAM;uBAGV,oBAAC;QAAI,WAAW;uBAMxB,oBAAC;QAAI,WAAW;OAAmBC"}
@@ -28,8 +28,7 @@ const FileInputRenderer = ({ value, onChange, label, ...props })=>{
28
28
  type: "compact",
29
29
  value: value,
30
30
  onSelectItem: ()=>showFileManager(),
31
- onRemoveItem: onRemove,
32
- onEditItem: ()=>showFileManager()
31
+ onRemoveItem: onRemove
33
32
  })
34
33
  });
35
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"inputRenderers/FileInput.js","sources":["../../src/inputRenderers/FileInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { FilePicker } from \"@webiny/admin-ui\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\nimport { FileManager, type FileManagerFileItem } from \"@webiny/app-admin\";\nimport { useBreakpoint } from \"~/BaseEditor/hooks/useBreakpoint.js\";\nimport type { FileInput } from \"@webiny/website-builder-sdk\";\nimport { fileManagerItemToValue } from \"~/shared/fileManagerItemToValue.js\";\n\nexport const FileInputRenderer = ({\n value,\n onChange,\n label,\n ...props\n}: ElementInputRendererProps) => {\n const input = props.input as FileInput;\n const { isBaseBreakpoint } = useBreakpoint();\n\n const onFileChange = (file: FileManagerFileItem) => {\n onChange(({ value }) => {\n const newValue = fileManagerItemToValue(file);\n value.set(newValue);\n });\n };\n\n const onRemove = () => {\n onChange(({ value }) => {\n if (isBaseBreakpoint) {\n value.set(undefined);\n } else {\n value.set(null);\n }\n });\n };\n\n return (\n <FileManager\n accept={input.allowedFileTypes}\n onChange={onFileChange}\n render={({ showFileManager }) => (\n <FilePicker\n variant={\"secondary\"}\n label={label}\n description={input.description}\n type=\"compact\"\n value={value}\n onSelectItem={() => showFileManager()}\n onRemoveItem={onRemove}\n onEditItem={() => showFileManager()}\n />\n )}\n />\n );\n};\n"],"names":["FileInputRenderer","value","onChange","label","props","input","isBaseBreakpoint","useBreakpoint","onFileChange","file","newValue","fileManagerItemToValue","onRemove","undefined","FileManager","showFileManager","FilePicker"],"mappings":";;;;;AAQO,MAAMA,oBAAoB,CAAC,EAC9BC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACL,GAAGC,OACqB;IACxB,MAAMC,QAAQD,MAAM,KAAK;IACzB,MAAM,EAAEE,gBAAgB,EAAE,GAAGC;IAE7B,MAAMC,eAAe,CAACC;QAClBP,SAAS,CAAC,EAAED,KAAK,EAAE;YACf,MAAMS,WAAWC,uBAAuBF;YACxCR,MAAM,GAAG,CAACS;QACd;IACJ;IAEA,MAAME,WAAW;QACbV,SAAS,CAAC,EAAED,KAAK,EAAE;YACf,IAAIK,kBACAL,MAAM,GAAG,CAACY;iBAEVZ,MAAM,GAAG,CAAC;QAElB;IACJ;IAEA,OAAO,WAAP,GACI,oBAACa,aAAWA;QACR,QAAQT,MAAM,gBAAgB;QAC9B,UAAUG;QACV,QAAQ,CAAC,EAAEO,eAAe,EAAE,iBACxB,oBAACC,YAAUA;gBACP,SAAS;gBACT,OAAOb;gBACP,aAAaE,MAAM,WAAW;gBAC9B,MAAK;gBACL,OAAOJ;gBACP,cAAc,IAAMc;gBACpB,cAAcH;gBACd,YAAY,IAAMG;;;AAKtC"}
1
+ {"version":3,"file":"inputRenderers/FileInput.js","sources":["../../src/inputRenderers/FileInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { FilePicker } from \"@webiny/admin-ui\";\nimport type { ElementInputRendererProps } from \"~/BaseEditor/index.js\";\nimport { FileManager, type FileManagerFileItem } from \"@webiny/app-admin\";\nimport { useBreakpoint } from \"~/BaseEditor/hooks/useBreakpoint.js\";\nimport type { FileInput } from \"@webiny/website-builder-sdk\";\nimport { fileManagerItemToValue } from \"~/shared/fileManagerItemToValue.js\";\n\nexport const FileInputRenderer = ({\n value,\n onChange,\n label,\n ...props\n}: ElementInputRendererProps) => {\n const input = props.input as FileInput;\n const { isBaseBreakpoint } = useBreakpoint();\n\n const onFileChange = (file: FileManagerFileItem) => {\n onChange(({ value }) => {\n const newValue = fileManagerItemToValue(file);\n value.set(newValue);\n });\n };\n\n const onRemove = () => {\n onChange(({ value }) => {\n if (isBaseBreakpoint) {\n value.set(undefined);\n } else {\n value.set(null);\n }\n });\n };\n\n return (\n <FileManager\n accept={input.allowedFileTypes}\n onChange={onFileChange}\n render={({ showFileManager }) => (\n <FilePicker\n variant={\"secondary\"}\n label={label}\n description={input.description}\n type=\"compact\"\n value={value}\n onSelectItem={() => showFileManager()}\n onRemoveItem={onRemove}\n />\n )}\n />\n );\n};\n"],"names":["FileInputRenderer","value","onChange","label","props","input","isBaseBreakpoint","useBreakpoint","onFileChange","file","newValue","fileManagerItemToValue","onRemove","undefined","FileManager","showFileManager","FilePicker"],"mappings":";;;;;AAQO,MAAMA,oBAAoB,CAAC,EAC9BC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACL,GAAGC,OACqB;IACxB,MAAMC,QAAQD,MAAM,KAAK;IACzB,MAAM,EAAEE,gBAAgB,EAAE,GAAGC;IAE7B,MAAMC,eAAe,CAACC;QAClBP,SAAS,CAAC,EAAED,KAAK,EAAE;YACf,MAAMS,WAAWC,uBAAuBF;YACxCR,MAAM,GAAG,CAACS;QACd;IACJ;IAEA,MAAME,WAAW;QACbV,SAAS,CAAC,EAAED,KAAK,EAAE;YACf,IAAIK,kBACAL,MAAM,GAAG,CAACY;iBAEVZ,MAAM,GAAG,CAAC;QAElB;IACJ;IAEA,OAAO,WAAP,GACI,oBAACa,aAAWA;QACR,QAAQT,MAAM,gBAAgB;QAC9B,UAAUG;QACV,QAAQ,CAAC,EAAEO,eAAe,EAAE,iBACxB,oBAACC,YAAUA;gBACP,SAAS;gBACT,OAAOb;gBACP,aAAaE,MAAM,WAAW;gBAC9B,MAAK;gBACL,OAAOJ;gBACP,cAAc,IAAMc;gBACpB,cAAcH;;;AAKlC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-website-builder",
3
- "version": "6.4.8",
3
+ "version": "6.4.9",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -21,28 +21,28 @@
21
21
  "@monaco-editor/react": "4.7.0",
22
22
  "@svgr/webpack": "8.1.0",
23
23
  "@types/react": "18.3.31",
24
- "@webiny/admin-ui": "6.4.8",
25
- "@webiny/app": "6.4.8",
26
- "@webiny/app-aco": "6.4.8",
27
- "@webiny/app-admin": "6.4.8",
28
- "@webiny/app-headless-cms-common": "6.4.8",
29
- "@webiny/app-trash-bin": "6.4.8",
30
- "@webiny/app-utils": "6.4.8",
24
+ "@webiny/admin-ui": "6.4.9",
25
+ "@webiny/app": "6.4.9",
26
+ "@webiny/app-aco": "6.4.9",
27
+ "@webiny/app-admin": "6.4.9",
28
+ "@webiny/app-headless-cms-common": "6.4.9",
29
+ "@webiny/app-trash-bin": "6.4.9",
30
+ "@webiny/app-utils": "6.4.9",
31
31
  "@webiny/di": "1.0.2",
32
- "@webiny/error": "6.4.8",
33
- "@webiny/feature": "6.4.8",
34
- "@webiny/form": "6.4.8",
35
- "@webiny/icons": "6.4.8",
36
- "@webiny/languages": "6.4.8",
37
- "@webiny/lexical-converter": "6.4.8",
38
- "@webiny/lexical-editor": "6.4.8",
39
- "@webiny/lexical-nodes": "6.4.8",
40
- "@webiny/lexical-theme": "6.4.8",
41
- "@webiny/react-composition": "6.4.8",
42
- "@webiny/react-properties": "6.4.8",
43
- "@webiny/utils": "6.4.8",
44
- "@webiny/validation": "6.4.8",
45
- "@webiny/website-builder-sdk": "6.4.8",
32
+ "@webiny/error": "6.4.9",
33
+ "@webiny/feature": "6.4.9",
34
+ "@webiny/form": "6.4.9",
35
+ "@webiny/icons": "6.4.9",
36
+ "@webiny/languages": "6.4.9",
37
+ "@webiny/lexical-converter": "6.4.9",
38
+ "@webiny/lexical-editor": "6.4.9",
39
+ "@webiny/lexical-nodes": "6.4.9",
40
+ "@webiny/lexical-theme": "6.4.9",
41
+ "@webiny/react-composition": "6.4.9",
42
+ "@webiny/react-properties": "6.4.9",
43
+ "@webiny/utils": "6.4.9",
44
+ "@webiny/validation": "6.4.9",
45
+ "@webiny/website-builder-sdk": "6.4.9",
46
46
  "apollo-cache": "1.3.5",
47
47
  "apollo-client": "2.6.10",
48
48
  "apollo-link": "1.2.14",
@@ -69,7 +69,7 @@
69
69
  "devDependencies": {
70
70
  "@types/deep-equal": "1.0.4",
71
71
  "@types/is-hotkey": "0.1.10",
72
- "@webiny/build-tools": "6.4.8",
72
+ "@webiny/build-tools": "6.4.9",
73
73
  "execa": "5.1.1",
74
74
  "rimraf": "6.1.3",
75
75
  "typescript": "6.0.3",