@sitecore-feaas/clientside 0.3.8 → 0.3.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.
- package/build/ui/FEAASExternal.js +3 -5
- package/build/ui/FEAASExternal.js.map +1 -1
- package/build/ui/react.js +3 -2
- package/build/ui/react.js.map +1 -1
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +6 -6
- package/dist/browser/react.cjs.map +3 -3
- package/dist/browser/react.esm.js +6 -6
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/react.cjs +4 -4
- package/dist/node/react.cjs.map +3 -3
- package/dist/node/react.esm.js +4 -4
- package/dist/node/react.esm.js.map +3 -3
- package/package.json +1 -1
- package/react.cjs +6 -6
- package/react.cjs.map +3 -3
- package/react.js +6 -6
- package/react.js.map +3 -3
- package/src/ui/FEAASExternal.tsx +4 -6
- package/src/ui/react.tsx +4 -2
- package/types/tsbuildinfo +1 -1
- package/types/ui/FEAASExternal.d.ts +2 -2
- package/types/ui/FEAASExternal.d.ts.map +1 -1
- package/types/ui/react.d.ts.map +1 -1
- package/types/ui/tsbuildinfo +1 -1
package/src/ui/FEAASExternal.tsx
CHANGED
|
@@ -82,14 +82,12 @@ export const parseProps = (propName: string, propValue: string, properties: JSON
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export function FEAASExternalProps(element: FEAASElement) {
|
|
86
|
-
const attributes = element.getAttributeNames()
|
|
85
|
+
export function FEAASExternalProps(element: FEAASElement): any {
|
|
87
86
|
const id = element.getAttribute('data-external-id')
|
|
88
87
|
const schema: JSONSchema = FEAASExternal.registered[id]?.schema
|
|
89
|
-
const props = attributes.reduce((prev,
|
|
90
|
-
if (!
|
|
91
|
-
|
|
92
|
-
return { ...prev, [reverseKebabCase(curr)]: parseProps(reverseKebabCase(curr), value, schema?.properties) }
|
|
88
|
+
const props = Array.from(element.attributes).reduce((prev, { name, value }) => {
|
|
89
|
+
if (!name.startsWith('data-attribute') && !['class', 'id', 'contenteditable'].includes(name)) {
|
|
90
|
+
return { ...prev, [reverseKebabCase(name)]: parseProps(reverseKebabCase(name), value, schema?.properties) }
|
|
93
91
|
} else {
|
|
94
92
|
return prev
|
|
95
93
|
}
|
package/src/ui/react.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FEAASComponentProps,
|
|
3
|
+
FEAASElement,
|
|
3
4
|
fetchComponent,
|
|
4
5
|
getComponentURL,
|
|
5
6
|
getStylesheetURL,
|
|
@@ -9,7 +10,7 @@ import React from 'react'
|
|
|
9
10
|
import { renderHTMLContent, HTMLNode, parseHTMLContent } from '../dom/html.js'
|
|
10
11
|
import { DataSettings } from '../utils/settings.js'
|
|
11
12
|
export { renderHTMLContent }
|
|
12
|
-
import { getComponent } from './FEAASExternal.js'
|
|
13
|
+
import { FEAASExternalProps, getComponent } from './FEAASExternal.js'
|
|
13
14
|
export { External, linkComponents, registerComponent, getComponent } from './FEAASExternal.js'
|
|
14
15
|
export * from './index.js'
|
|
15
16
|
export * from '../headless.js'
|
|
@@ -45,7 +46,8 @@ export function FEAASReactComponent({ data, ...props }: FEAASReactComponentProps
|
|
|
45
46
|
node,
|
|
46
47
|
(node) => {
|
|
47
48
|
if (node.localName == 'feaas-external' && getComponent(node.getAttribute('data-external-id'))) {
|
|
48
|
-
|
|
49
|
+
const { dataExternalId, ...props } = FEAASExternalProps(node as any)
|
|
50
|
+
return [FEAASReactExternal, props]
|
|
49
51
|
}
|
|
50
52
|
},
|
|
51
53
|
index
|