@woodylab/payload 0.0.133 → 0.0.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LayoutRenderer-B9mdu_LN.js +2 -0
- package/dist/LayoutRenderer-B9mdu_LN.js.map +1 -0
- package/dist/LayoutRenderer-DHEQyk3K.js +2 -0
- package/dist/LayoutRenderer-DHEQyk3K.js.map +1 -0
- package/dist/config/blocks/blockCard.js +159 -84
- package/dist/config/blocks/blockView.js +38 -7
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/react/LayoutRenderer.js +6 -7
- package/dist/react/componentRegistry.js +6 -2
- package/dist/react/components/Card.d.ts +1 -1
- package/dist/react/components/Card.js +2 -1
- package/dist/react/components/Section.d.ts +5 -0
- package/dist/react/components/Section.js +4 -0
- package/dist/react/components/View.d.ts +1 -1
- package/dist/react/components/View.js +4 -6
- package/dist/react/index.cjs.js +1 -1
- package/dist/react/index.esm.js +1 -1
- package/dist/resolveLayout-C5t_MveG.js +2 -0
- package/dist/resolveLayout-C5t_MveG.js.map +1 -0
- package/dist/resolveLayout-DGll1vY2.js +2 -0
- package/dist/resolveLayout-DGll1vY2.js.map +1 -0
- package/dist/uims/index.cjs.js +1 -1
- package/dist/uims/index.esm.js +1 -1
- package/dist/uims/resolver/resolveInlineBlock.d.ts +10 -3
- package/dist/uims/resolver/resolveInlineBlock.js +23 -12
- package/dist/uims/resolver/resolveViewBlock.d.ts +13 -5
- package/dist/uims/resolver/resolveViewBlock.js +27 -18
- package/package.json +1 -1
- package/dist/LayoutRenderer-B1IoWb16.js +0 -2
- package/dist/LayoutRenderer-B1IoWb16.js.map +0 -1
- package/dist/LayoutRenderer-Ba6ITI7O.js +0 -2
- package/dist/LayoutRenderer-Ba6ITI7O.js.map +0 -1
- package/dist/react/ComponentRenderer.d.ts +0 -1
- package/dist/react/ComponentRenderer.js +0 -29
- package/dist/resolveLayout-DlRnQBn8.js +0 -2
- package/dist/resolveLayout-DlRnQBn8.js.map +0 -1
- package/dist/resolveLayout-DryOXHEy.js +0 -2
- package/dist/resolveLayout-DryOXHEy.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=require("react/jsx-runtime"),t=require("./resolveLayout-C5t_MveG.js");let e=null;async function o(n){if(e)return e;const t=await n.find({collection:"styles",depth:4,pagination:!1}),o={};for(const n of t.docs??[])n.name&&(o[n.name]=n);return e={byName:o},e}let a=null;async function i(n){if(a)return a;const t=await n.find({collection:"view-modes",depth:4,pagination:!1}),e={};for(const n of t.docs??[])n.name&&(e[n.name]=n);return a={byName:e},a}let r=null;async function c(n){if(r)return r;const t=await n.find({collection:"component-definitions",depth:4,pagination:!1}),e={};for(const n of t.docs??[])n.name&&(e[n.name]=n);return r={byName:e},r}exports.LayoutRenderer=async function({layout:e,payload:a}){const r=await async function(n){return{payload:n,registries:{styles:await o(n),viewMode:await i(n),component:await c(n)}}}(a),s=await t.resolveLayout({layout:e,context:r});return n.jsx(n.Fragment,{children:s.map((t,e)=>{if(!t)return null;const{section:o,container:a,content:i}=t,{SectionComponent:r,SectionStylesBySlot:c}=o,{ContainerComponent:s,ContainerStylesBySlot:l}=a,{ContentComponent:u}=i;return n.jsx(r,{className:c.root,children:n.jsx(s,{className:l.root,children:n.jsx(u,{...i})})},e)})})};
|
|
2
|
+
//# sourceMappingURL=LayoutRenderer-B9mdu_LN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutRenderer-B9mdu_LN.js","sources":["../src/uims/registry/styleRegistry.ts","../src/uims/registry/viewModeRegistry.ts","../src/uims/registry/componentRegistry.ts","../src/react/LayoutRenderer.tsx","../src/uims/resolver/createUIMSContext.ts"],"sourcesContent":["import { BasePayload } from 'payload'\n\nlet cache: {\n byName: Record<string, any>\n} | null = null\n\n//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection\nexport async function getStyleRegistry(payload: BasePayload) {\n if (cache) {\n return cache\n }\n\n const result = await payload.find({\n collection: 'styles',\n depth: 4,\n pagination: false,\n })\n\n const byName: Record<string, any> = {}\n\n for (const vm of result.docs ?? []) {\n if (vm.name) {\n byName[vm.name] = vm\n }\n }\n\n cache = { byName }\n return cache\n}\n","import { BasePayload } from 'payload'\n\nlet cache: {\n byName: Record<string, any>\n} | null = null\n\n//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection\nexport async function getViewModeRegistry(payload: BasePayload) {\n if (cache) {\n return cache\n }\n\n const result = await payload.find({\n collection: 'view-modes',\n depth: 4,\n pagination: false,\n })\n\n const byName: Record<string, any> = {}\n\n for (const vm of result.docs ?? []) {\n if (vm.name) {\n byName[vm.name] = vm\n }\n }\n\n cache = { byName }\n return cache\n}\n","import { BasePayload } from 'payload'\n\nlet cache: {\n byName: Record<string, any>\n} | null = null\n\n//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection\nexport async function getComponentRegistry(payload: BasePayload) {\n if (cache) {\n return cache\n }\n\n const result = await payload.find({\n collection: 'component-definitions',\n depth: 4,\n pagination: false,\n })\n\n const byName: Record<string, any> = {}\n\n for (const vm of result.docs ?? []) {\n if (vm.name) {\n byName[vm.name] = vm\n }\n }\n\n cache = { byName }\n return cache\n}\n","import { BasePayload } from 'payload'\nimport { resolveLayout } from '../uims'\nimport { createUIMSContext } from '../uims/resolver/createUIMSContext'\n\n//#TODO Ricordarsi di introdurre il concetto di PageRenderer, sarebbe carino se riuscissimo a delegarle la stampa anche dei meta dati e info accessorie oltre al layout.\nexport async function LayoutRenderer({ layout, payload }: { layout: any[]; payload: BasePayload }) {\n const uims = await createUIMSContext(payload)\n const resolvedLayout = await resolveLayout({ layout, context: uims })\n return (\n <>\n {resolvedLayout.map((block: any, i: any) => {\n if (!block) return null\n const { section, container, content } = block\n const { SectionComponent, SectionStylesBySlot } = section\n const { ContainerComponent, ContainerStylesBySlot } = container\n const { ContentComponent } = content\n // #TODO sarebbe carino rimuovere la stampa condizionale e includere invece un blocco View come componente per la stampa generica\n\n return (\n <SectionComponent key={i} className={SectionStylesBySlot.root}>\n <ContainerComponent className={ContainerStylesBySlot.root}>\n <ContentComponent {...content} />\n </ContainerComponent>\n </SectionComponent>\n )\n })}\n </>\n )\n}\n","import { BasePayload } from 'payload'\nimport { UIMSContext } from '../types/UIMSContext'\nimport { getStyleRegistry } from '../registry/styleRegistry'\nimport { getViewModeRegistry } from '../registry/viewModeRegistry'\nimport { getComponentRegistry } from '../registry/componentRegistry'\n\nexport async function createUIMSContext(payload: BasePayload): Promise<UIMSContext> {\n return {\n payload,\n registries: {\n styles: await getStyleRegistry(payload),\n viewMode: await getViewModeRegistry(payload),\n component: await getComponentRegistry(payload),\n },\n }\n}\n"],"names":["cache","async","getStyleRegistry","payload","result","find","collection","depth","pagination","byName","vm","docs","name","getViewModeRegistry","getComponentRegistry","layout","uims","registries","styles","viewMode","component","createUIMSContext","resolvedLayout","resolveLayout","context","_jsx","_Fragment","children","map","block","i","section","container","content","SectionComponent","SectionStylesBySlot","ContainerComponent","ContainerStylesBySlot","ContentComponent","className","root"],"mappings":"yFAEA,IAAIA,EAEO,KAGJC,eAAeC,EAAiBC,GACrC,GAAIH,EACF,OAAOA,EAGT,MAAMI,QAAeD,EAAQE,KAAK,CAChCC,WAAY,SACZC,MAAO,EACPC,YAAY,IAGRC,EAA8B,CAAA,EAEpC,IAAK,MAAMC,KAAMN,EAAOO,MAAQ,GAC1BD,EAAGE,OACLH,EAAOC,EAAGE,MAAQF,GAKtB,OADAV,EAAQ,CAAES,UACHT,CACT,CC1BA,IAAIA,EAEO,KAGJC,eAAeY,EAAoBV,GACxC,GAAIH,EACF,OAAOA,EAGT,MAAMI,QAAeD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time";import{a as o}from"./resolveLayout-DGll1vY2.js";let e=null;async function a(n){if(e)return e;const t=await n.find({collection:"styles",depth:4,pagination:!1}),o={};for(const n of t.docs??[])n.name&&(o[n.name]=n);return e={byName:o},e}let i=null;async function c(n){if(i)return i;const t=await n.find({collection:"view-modes",depth:4,pagination:!1}),o={};for(const n of t.docs??[])n.name&&(o[n.name]=n);return i={byName:o},i}let r=null;async function s(n){if(r)return r;const t=await n.find({collection:"component-definitions",depth:4,pagination:!1}),o={};for(const n of t.docs??[])n.name&&(o[n.name]=n);return r={byName:o},r}async function l({layout:e,payload:i}){const r=await async function(n){return{payload:n,registries:{styles:await a(n),viewMode:await c(n),component:await s(n)}}}(i),l=await o({layout:e,context:r});return n(t,{children:l.map((t,o)=>{if(!t)return null;const{section:e,container:a,content:i}=t,{SectionComponent:c,SectionStylesBySlot:r}=e,{ContainerComponent:s,ContainerStylesBySlot:l}=a,{ContentComponent:m}=i;return n(c,{className:r.root,children:n(s,{className:l.root,children:n(m,{...i})})},o)})})}export{l as L};
|
|
2
|
+
//# sourceMappingURL=LayoutRenderer-DHEQyk3K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutRenderer-DHEQyk3K.js","sources":["../src/uims/registry/styleRegistry.ts","../src/uims/registry/viewModeRegistry.ts","../src/uims/registry/componentRegistry.ts","../src/react/LayoutRenderer.tsx","../src/uims/resolver/createUIMSContext.ts"],"sourcesContent":["import { BasePayload } from 'payload'\n\nlet cache: {\n byName: Record<string, any>\n} | null = null\n\n//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection\nexport async function getStyleRegistry(payload: BasePayload) {\n if (cache) {\n return cache\n }\n\n const result = await payload.find({\n collection: 'styles',\n depth: 4,\n pagination: false,\n })\n\n const byName: Record<string, any> = {}\n\n for (const vm of result.docs ?? []) {\n if (vm.name) {\n byName[vm.name] = vm\n }\n }\n\n cache = { byName }\n return cache\n}\n","import { BasePayload } from 'payload'\n\nlet cache: {\n byName: Record<string, any>\n} | null = null\n\n//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection\nexport async function getViewModeRegistry(payload: BasePayload) {\n if (cache) {\n return cache\n }\n\n const result = await payload.find({\n collection: 'view-modes',\n depth: 4,\n pagination: false,\n })\n\n const byName: Record<string, any> = {}\n\n for (const vm of result.docs ?? []) {\n if (vm.name) {\n byName[vm.name] = vm\n }\n }\n\n cache = { byName }\n return cache\n}\n","import { BasePayload } from 'payload'\n\nlet cache: {\n byName: Record<string, any>\n} | null = null\n\n//# TODO sarebbe sensato cancellare la cache o forzare un nuovo caricamento quando viene fatta una modifica a uno degli elementi della collection\nexport async function getComponentRegistry(payload: BasePayload) {\n if (cache) {\n return cache\n }\n\n const result = await payload.find({\n collection: 'component-definitions',\n depth: 4,\n pagination: false,\n })\n\n const byName: Record<string, any> = {}\n\n for (const vm of result.docs ?? []) {\n if (vm.name) {\n byName[vm.name] = vm\n }\n }\n\n cache = { byName }\n return cache\n}\n","import { BasePayload } from 'payload'\nimport { resolveLayout } from '../uims'\nimport { createUIMSContext } from '../uims/resolver/createUIMSContext'\n\n//#TODO Ricordarsi di introdurre il concetto di PageRenderer, sarebbe carino se riuscissimo a delegarle la stampa anche dei meta dati e info accessorie oltre al layout.\nexport async function LayoutRenderer({ layout, payload }: { layout: any[]; payload: BasePayload }) {\n const uims = await createUIMSContext(payload)\n const resolvedLayout = await resolveLayout({ layout, context: uims })\n return (\n <>\n {resolvedLayout.map((block: any, i: any) => {\n if (!block) return null\n const { section, container, content } = block\n const { SectionComponent, SectionStylesBySlot } = section\n const { ContainerComponent, ContainerStylesBySlot } = container\n const { ContentComponent } = content\n // #TODO sarebbe carino rimuovere la stampa condizionale e includere invece un blocco View come componente per la stampa generica\n\n return (\n <SectionComponent key={i} className={SectionStylesBySlot.root}>\n <ContainerComponent className={ContainerStylesBySlot.root}>\n <ContentComponent {...content} />\n </ContainerComponent>\n </SectionComponent>\n )\n })}\n </>\n )\n}\n","import { BasePayload } from 'payload'\nimport { UIMSContext } from '../types/UIMSContext'\nimport { getStyleRegistry } from '../registry/styleRegistry'\nimport { getViewModeRegistry } from '../registry/viewModeRegistry'\nimport { getComponentRegistry } from '../registry/componentRegistry'\n\nexport async function createUIMSContext(payload: BasePayload): Promise<UIMSContext> {\n return {\n payload,\n registries: {\n styles: await getStyleRegistry(payload),\n viewMode: await getViewModeRegistry(payload),\n component: await getComponentRegistry(payload),\n },\n }\n}\n"],"names":["cache","async","getStyleRegistry","payload","result","find","collection","depth","pagination","byName","vm","docs","name","getViewModeRegistry","getComponentRegistry","LayoutRenderer","layout","uims","registries","styles","viewMode","component","createUIMSContext","resolvedLayout","resolveLayout","context","_jsx","_Fragment","children","map","block","i","section","container","content","SectionComponent","SectionStylesBySlot","ContainerComponent","ContainerStylesBySlot","ContentComponent","className","root"],"mappings":"sGAEA,IAAIA,EAEO,KAGJC,eAAeC,EAAiBC,GACrC,GAAIH,EACF,OAAOA,EAGT,MAAMI,QAAeD,EAAQE,KAAK,CAChCC,WAAY,SACZC,MAAO,EACPC,YAAY,IAGRC,EAA8B,CAAA,EAEpC,IAAK,MAAMC,KAAMN,EAAOO,MAAQ,GAC1BD,EAAGE,OACLH,EAAOC,EAAGE,MAAQF,GAKtB,OADAV,EAAQ,CAAES,UACHT,CACT,CC1BA,IAAIA,EAEO,KAGJC,eAAeY,EAAoBV,GACxC,GAAIH,EACF,OAAOA,EAGT,MAAMI,QAAeD,EAAQE,KAAK,CAChCC,WAAY,aACZC,MAAO,EACPC,YAAY,IAGRC,EAA8B,CAAA,EAEpC,IAAK,MAAMC,KAAMN,EAAOO,MAAQ,GAC1BD,EAAGE,OACLH,EAAOC,EAAGE,MAAQF,GAKtB,OADAV,EAAQ,CAAES,UACHT,CACT,CC1BA,IAAIA,EAEO,KAGJC,eAAea,EAAqBX,GACzC,GAAIH,EACF,OAAOA,EAGT,MAAMI,QAAeD,EAAQE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
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'descriptionProps',
|
|
43
|
-
type: 'group',
|
|
44
|
-
fields: [
|
|
45
|
-
{
|
|
46
|
-
name: 'text',
|
|
47
|
-
type: 'text',
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'imageProps',
|
|
53
|
-
type: 'group',
|
|
54
|
-
fields: [
|
|
55
|
-
{
|
|
56
|
-
name: 'text',
|
|
57
|
-
type: 'text',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
type: 'relationship',
|
|
61
|
-
name: 'image',
|
|
62
|
-
relationTo: ['media'],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'altText',
|
|
66
|
-
type: 'text',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'actionProps',
|
|
72
|
-
type: 'group',
|
|
73
|
-
fields: [
|
|
74
|
-
{
|
|
75
|
-
name: 'text',
|
|
76
|
-
type: 'text',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'target',
|
|
80
|
-
type: 'text',
|
|
9
|
+
label: 'Section',
|
|
10
|
+
description: 'Section sample text',
|
|
11
|
+
fields: [
|
|
12
|
+
{
|
|
13
|
+
type: 'row',
|
|
14
|
+
fields: [
|
|
15
|
+
{
|
|
16
|
+
name: 'sectionViewMode',
|
|
17
|
+
type: 'text',
|
|
18
|
+
defaultValue: 'Section',
|
|
19
|
+
admin: {
|
|
20
|
+
width: '50%',
|
|
21
|
+
},
|
|
22
|
+
hooks: {
|
|
23
|
+
beforeChange: [resolveViewModeFromRef('sectionViewModeRef')],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'sectionViewModeRef',
|
|
28
|
+
type: 'relationship',
|
|
29
|
+
virtual: true,
|
|
30
|
+
relationTo: ['view-modes'],
|
|
31
|
+
admin: {
|
|
32
|
+
width: '50%',
|
|
33
|
+
description: 'campo helper per la sola visualizzazione o selezione di un viewMode, viene usato il valore inserito nel campo precedente per determinare la struttura del layout',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
81
39
|
},
|
|
82
40
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
|
|
41
|
+
label: 'Container',
|
|
42
|
+
description: 'Container sample text',
|
|
43
|
+
fields: [
|
|
44
|
+
{
|
|
45
|
+
type: 'row',
|
|
46
|
+
fields: [
|
|
47
|
+
{
|
|
48
|
+
name: 'containerViewMode',
|
|
49
|
+
type: 'text',
|
|
50
|
+
defaultValue: 'Container',
|
|
51
|
+
admin: {
|
|
52
|
+
width: '50%',
|
|
53
|
+
},
|
|
54
|
+
hooks: {
|
|
55
|
+
beforeChange: [resolveViewModeFromRef('containerViewModeRef')],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'containerViewModeRef',
|
|
60
|
+
type: 'relationship',
|
|
61
|
+
virtual: true,
|
|
62
|
+
relationTo: ['view-modes'],
|
|
63
|
+
admin: {
|
|
64
|
+
width: '50%',
|
|
65
|
+
description: 'campo helper per la sola visualizzazione o selezione di un viewMode, viene usato il valore inserito nel campo precedente per determinare la struttura del layout',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
88
70
|
],
|
|
89
71
|
},
|
|
90
72
|
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
73
|
+
label: 'Content',
|
|
74
|
+
description: 'Content sample text',
|
|
75
|
+
fields: [
|
|
76
|
+
{
|
|
77
|
+
type: 'row',
|
|
78
|
+
fields: [
|
|
79
|
+
{
|
|
80
|
+
name: 'viewMode',
|
|
81
|
+
type: 'text',
|
|
82
|
+
defaultValue: '',
|
|
83
|
+
admin: {
|
|
84
|
+
width: '50%',
|
|
85
|
+
},
|
|
86
|
+
hooks: {
|
|
87
|
+
beforeChange: [resolveViewModeFromRef('viewModeRef')],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'viewModeRef',
|
|
92
|
+
type: 'relationship',
|
|
93
|
+
virtual: true,
|
|
94
|
+
relationTo: ['view-modes'],
|
|
95
|
+
admin: {
|
|
96
|
+
width: '50%',
|
|
97
|
+
description: 'campo helper per la sola visualizzazione o selezione di un viewMode, viene usato il valore inserito nel campo precedente per determinare la struttura del layout',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'titleProps',
|
|
104
|
+
type: 'group',
|
|
105
|
+
fields: [
|
|
106
|
+
{
|
|
107
|
+
name: 'text',
|
|
108
|
+
type: 'text',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'descriptionProps',
|
|
114
|
+
type: 'group',
|
|
115
|
+
fields: [
|
|
116
|
+
{
|
|
117
|
+
name: 'text',
|
|
118
|
+
type: 'text',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'imageProps',
|
|
124
|
+
type: 'group',
|
|
125
|
+
fields: [
|
|
126
|
+
{
|
|
127
|
+
name: 'text',
|
|
128
|
+
type: 'text',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: 'relationship',
|
|
132
|
+
name: 'image',
|
|
133
|
+
relationTo: ['media'],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'altText',
|
|
137
|
+
type: 'text',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'actionProps',
|
|
143
|
+
type: 'group',
|
|
144
|
+
fields: [
|
|
145
|
+
{
|
|
146
|
+
name: 'text',
|
|
147
|
+
type: 'text',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'target',
|
|
151
|
+
type: 'text',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'actionType',
|
|
155
|
+
type: 'select',
|
|
156
|
+
options: [
|
|
157
|
+
{ label: 'Navigate', value: 'navigate' },
|
|
158
|
+
{ label: 'Scroll', value: 'scroll' },
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'actionTarget',
|
|
163
|
+
type: 'select',
|
|
164
|
+
options: [
|
|
165
|
+
{ label: 'URL', value: 'url' },
|
|
166
|
+
{ label: 'ID', value: 'id' },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
},
|
|
96
171
|
],
|
|
97
172
|
},
|
|
98
173
|
],
|
|
@@ -10,7 +10,7 @@ export const blockView = {
|
|
|
10
10
|
type: 'tabs',
|
|
11
11
|
tabs: [
|
|
12
12
|
{
|
|
13
|
-
label: '
|
|
13
|
+
label: 'Config',
|
|
14
14
|
fields: [
|
|
15
15
|
{
|
|
16
16
|
name: 'useInternalSource',
|
|
@@ -110,24 +110,55 @@ export const blockView = {
|
|
|
110
110
|
],
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
|
-
label: '
|
|
113
|
+
label: 'Section',
|
|
114
114
|
fields: [
|
|
115
115
|
{
|
|
116
116
|
type: 'row',
|
|
117
117
|
fields: [
|
|
118
118
|
{
|
|
119
|
-
name: '
|
|
119
|
+
name: 'sectionViewMode',
|
|
120
120
|
type: 'text',
|
|
121
|
-
defaultValue: '',
|
|
121
|
+
defaultValue: 'Section',
|
|
122
|
+
admin: {
|
|
123
|
+
width: '50%',
|
|
124
|
+
},
|
|
125
|
+
hooks: {
|
|
126
|
+
beforeChange: [resolveViewModeFromRef('sectionViewModeRef')],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'sectionViewModeRef',
|
|
131
|
+
type: 'relationship',
|
|
132
|
+
virtual: true,
|
|
133
|
+
relationTo: ['view-modes'],
|
|
134
|
+
admin: {
|
|
135
|
+
width: '50%',
|
|
136
|
+
description: 'campo helper per la sola visualizzazione o selezione di un viewMode, viene usato il valore inserito nel campo precedente per determinare la struttura del layout',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: 'Container',
|
|
145
|
+
fields: [
|
|
146
|
+
{
|
|
147
|
+
type: 'row',
|
|
148
|
+
fields: [
|
|
149
|
+
{
|
|
150
|
+
name: 'containerViewMode',
|
|
151
|
+
type: 'text',
|
|
152
|
+
defaultValue: 'Container',
|
|
122
153
|
admin: {
|
|
123
154
|
width: '50%',
|
|
124
155
|
},
|
|
125
156
|
hooks: {
|
|
126
|
-
beforeChange: [resolveViewModeFromRef('
|
|
157
|
+
beforeChange: [resolveViewModeFromRef('containerViewModeRef')],
|
|
127
158
|
},
|
|
128
159
|
},
|
|
129
160
|
{
|
|
130
|
-
name: '
|
|
161
|
+
name: 'containerViewModeRef',
|
|
131
162
|
type: 'relationship',
|
|
132
163
|
virtual: true,
|
|
133
164
|
relationTo: ['view-modes'],
|
|
@@ -146,7 +177,7 @@ export const blockView = {
|
|
|
146
177
|
],
|
|
147
178
|
},
|
|
148
179
|
{
|
|
149
|
-
label: '
|
|
180
|
+
label: 'Content',
|
|
150
181
|
fields: [
|
|
151
182
|
{
|
|
152
183
|
type: 'row',
|