@sitecore-feaas/clientside 0.3.17 → 0.3.18

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.
@@ -259,6 +259,7 @@ declare global {
259
259
  interface IntrinsicElements {
260
260
  'feaas-component': {
261
261
  data?: any
262
+ class?: string
262
263
  suppressHydrationWarning?: boolean
263
264
  template?: string
264
265
  instance?: string
@@ -288,4 +289,4 @@ declare global {
288
289
  }
289
290
  FEAASComponent.register('feaas-component')
290
291
 
291
- export { FEAASComponent as Component, FEAASComponentsProps as ComponentProps }
292
+ export { FEAASComponent as Component, FEAASComponentsProps as ComponentProps }
package/src/ui/react.tsx CHANGED
@@ -108,6 +108,7 @@ export function FEAASReactComponent({ data, ...props }: FEAASReactComponentProps
108
108
  </>
109
109
  )}
110
110
  <feaas-component
111
+ class='-feaas'
111
112
  {...props}
112
113
  suppressHydrationWarning
113
114
  template={null}
@@ -53,7 +53,7 @@ describe('React', () => {
53
53
  <section>
54
54
  <Component src='library/test'></Component>
55
55
  </section>,
56
- '<section><feaas-component library="library" component="test" src="library/test" hydrate="false"></feaas-component></section>'
56
+ '<section><feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false"></feaas-component></section>'
57
57
  )
58
58
  })
59
59
  it('render react with empty template', async () => {
@@ -61,7 +61,7 @@ describe('React', () => {
61
61
  <section>
62
62
  <Component src='library/test' template=''></Component>
63
63
  </section>,
64
- '<section><feaas-component library="library" component="test" src="library/test" hydrate="false"></feaas-component></section>'
64
+ '<section><feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false"></feaas-component></section>'
65
65
  )
66
66
  })
67
67
  it('render react component with src and overrides', async () => {
@@ -69,7 +69,7 @@ describe('React', () => {
69
69
  <section>
70
70
  <Component src='library/test' component='test2'></Component>
71
71
  </section>,
72
- '<section><feaas-component library="library" component="test2" src="library/test" hydrate="false"></feaas-component></section>'
72
+ '<section><feaas-component class="-feaas" library="library" component="test2" src="library/test" hydrate="false"></feaas-component></section>'
73
73
  )
74
74
  })
75
75
  it('render react component with extras', async () => {
@@ -77,7 +77,7 @@ describe('React', () => {
77
77
  <section>
78
78
  <Component src='library/test' version='v1'></Component>
79
79
  </section>,
80
- '<section><feaas-component library="library" component="test" version="v1" src="library/test" hydrate="false"></feaas-component></section>'
80
+ '<section><feaas-component class="-feaas" library="library" component="test" version="v1" src="library/test" hydrate="false"></feaas-component></section>'
81
81
  )
82
82
  })
83
83
  it('render react template', async () => {
@@ -85,7 +85,7 @@ describe('React', () => {
85
85
  <section>
86
86
  <Component src='library/test' template={'<div data-path-src="abc">'}></Component>
87
87
  </section>,
88
- '<section><feaas-component library="library" component="test" src="library/test" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
88
+ '<section><feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
89
89
  )
90
90
  })
91
91
  it('render template with data and src', async () => {
@@ -93,7 +93,7 @@ describe('React', () => {
93
93
  <section>
94
94
  <Component src='library/test' template={'<div data-path-src="abc">'} data={{ abc: 321 }}></Component>
95
95
  </section>,
96
- '<section><feaas-component library="library" component="test" src="library/test" data="{&quot;abc&quot;:321}" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
96
+ '<section><feaas-component class="-feaas" library="library" component="test" src="library/test" data="{&quot;abc&quot;:321}" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
97
97
  )
98
98
  })
99
99
  it('render template with data but without src', async () => {
@@ -106,7 +106,7 @@ describe('React', () => {
106
106
  data={{ abc: 321 }}
107
107
  ></Component>
108
108
  </section>,
109
- '<section><feaas-component library="library" component="test" data="{&quot;abc&quot;:321}" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
109
+ '<section><feaas-component class="-feaas" library="library" component="test" data="{&quot;abc&quot;:321}" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
110
110
  )
111
111
  })
112
112
  it('render template with style attribute', async () => {
@@ -114,7 +114,7 @@ describe('React', () => {
114
114
  <section>
115
115
  <Component template={'<div data-path-src="abc">'} data={{ abc: 321 }}></Component>
116
116
  </section>,
117
- '<section><feaas-component data="{&quot;abc&quot;:321}" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
117
+ '<section><feaas-component class="-feaas" data="{&quot;abc&quot;:321}" hydrate="false"><div data-path-src="abc"></div></feaas-component></section>'
118
118
  )
119
119
  })
120
120
  it('render unwrapped external component with stringified values', async () => {
@@ -137,7 +137,7 @@ describe('React', () => {
137
137
  data={{ abc: 321 }}
138
138
  ></Component>
139
139
  </section>,
140
- '<section><feaas-component data="{&quot;abc&quot;:321}" hydrate="false"><feaas-external telephone="12345" first-name="Yarik" data-external-id="MyTestComponent" hydrate="false"><div>Hello my name is Yarik (string) and my tel is 12345 (number). And context value is DEFAULT</div></feaas-external></feaas-component></section>'
140
+ '<section><feaas-component class="-feaas" data="{&quot;abc&quot;:321}" hydrate="false"><feaas-external telephone="12345" first-name="Yarik" data-external-id="MyTestComponent" hydrate="false"><div>Hello my name is Yarik (string) and my tel is 12345 (number). And context value is DEFAULT</div></feaas-external></feaas-component></section>'
141
141
  )
142
142
  })
143
143
  it('render wrapped external component with context provider', async () => {
@@ -153,7 +153,7 @@ describe('React', () => {
153
153
  ></Component>
154
154
  </section>
155
155
  </DataContext.Provider>,
156
- '<section><feaas-component data="{&quot;abc&quot;:321}" hydrate="false"><feaas-external telephone="12345" first-name="Yarik" data-external-id="MyTestComponent" hydrate="false"><div>Hello my name is Yarik (string) and my tel is 12345 (number). And context value is INHERITED</div></feaas-external></feaas-component></section>'
156
+ '<section><feaas-component class="-feaas" data="{&quot;abc&quot;:321}" hydrate="false"><feaas-external telephone="12345" first-name="Yarik" data-external-id="MyTestComponent" hydrate="false"><div>Hello my name is Yarik (string) and my tel is 12345 (number). And context value is INHERITED</div></feaas-external></feaas-component></section>'
157
157
  )
158
158
  })
159
159
  it('render wrapped external component with context provider and data mapping', async () => {
@@ -169,7 +169,7 @@ describe('React', () => {
169
169
  ></Component>
170
170
  </section>
171
171
  </DataContext.Provider>,
172
- '<section><feaas-component data="{&quot;telephone&quot;:321}" hydrate="false"><feaas-external data-path-attributes="$" first-name="Yarik" telephone="321" data-attributes-keys="telephone" data-external-id="MyTestComponent" hydrate="false"><div>Hello my name is Yarik (string) and my tel is 321 (number). And context value is INHERITED</div></feaas-external></feaas-component></section>'
172
+ '<section><feaas-component class="-feaas" data="{&quot;telephone&quot;:321}" hydrate="false"><feaas-external data-path-attributes="$" first-name="Yarik" telephone="321" data-attributes-keys="telephone" data-external-id="MyTestComponent" hydrate="false"><div>Hello my name is Yarik (string) and my tel is 321 (number). And context value is INHERITED</div></feaas-external></feaas-component></section>'
173
173
  )
174
174
  })
175
175
  })
@@ -27,7 +27,7 @@ describe('React Server', () => {
27
27
 
28
28
  await validate(
29
29
  <>{Component}</>,
30
- `<feaas-component library="library" component="test" src="library/test" hydrate="false" data="{&quot;data&quot;:&quot;1&quot;}">{"data": "1"}</feaas-component>`
30
+ `<feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false" data="{&quot;data&quot;:&quot;1&quot;}">{"data": "1"}</feaas-component>`
31
31
  )
32
32
  })
33
33
  it('render with object data', async () => {
@@ -38,7 +38,7 @@ describe('React Server', () => {
38
38
  const Component = await ServerComponent({ src: 'library/test', data: { data: '2' } })
39
39
  await validate(
40
40
  <>{Component}</>,
41
- `<feaas-component library="library" component="test" src="library/test" hydrate="false" data="{&quot;data&quot;:&quot;2&quot;}">Test</feaas-component>`
41
+ `<feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false" data="{&quot;data&quot;:&quot;2&quot;}">Test</feaas-component>`
42
42
  )
43
43
  })
44
44
  it('pre-render data', async () => {
@@ -50,7 +50,7 @@ describe('React Server', () => {
50
50
  const Component = await ServerComponent({ src: 'library/test', data: { value: 0 } })
51
51
  await validate(
52
52
  <>{Component}</>,
53
- `<feaas-component library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}">Hey: <var data-path="value">0</var>!</feaas-component>`
53
+ `<feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}">Hey: <var data-path="value">0</var>!</feaas-component>`
54
54
  )
55
55
  })
56
56
  it('pre-render data with style attribute', async () => {
@@ -64,7 +64,7 @@ describe('React Server', () => {
64
64
  const Component = await ServerComponent({ src: 'library/test', data: { value: 0 } })
65
65
  await validate(
66
66
  <>{Component}</>,
67
- `<feaas-component library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p style="text-align: left; color: red;"><b style="cursor: 1;">Hey:</b> <var data-path="value">0</var>!</p></feaas-component>`
67
+ `<feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p style="text-align: left; color: red;"><b style="cursor: 1;">Hey:</b> <var data-path="value">0</var>!</p></feaas-component>`
68
68
  )
69
69
  })
70
70
  it('pre-render data with whitespace', async () => {
@@ -76,7 +76,7 @@ describe('React Server', () => {
76
76
  const Component = await ServerComponent({ src: 'library/test', data: { value: 0 } })
77
77
  await validate(
78
78
  <>{Component}</>,
79
- `<feaas-component library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p>Test <b>Hey:</b> <i>Dawg</i> <var data-path="value">0</var>!</p></feaas-component>`
79
+ `<feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p>Test <b>Hey:</b> <i>Dawg</i> <var data-path="value">0</var>!</p></feaas-component>`
80
80
  )
81
81
  })
82
82
  it('render external component', async () => {
@@ -96,7 +96,7 @@ describe('React Server', () => {
96
96
  const Component = await ServerComponent({ src: 'library/test', data: { value: 0 } })
97
97
  await validate(
98
98
  <>{Component}</>,
99
- `<feaas-component library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p>This?</p><feaas-external hydrate="false" data-external-id="test-server-external"><h1>My Component</h1></feaas-external></feaas-component>`
99
+ `<feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p>This?</p><feaas-external hydrate="false" data-external-id="test-server-external"><h1>My Component</h1></feaas-external></feaas-component>`
100
100
  )
101
101
  })
102
102
  it('render external component with context', async () => {
@@ -122,7 +122,7 @@ describe('React Server', () => {
122
122
  <Context.Provider value={{ test: 'cde' }}>
123
123
  <>{Component}</>
124
124
  </Context.Provider>,
125
- `<feaas-component library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p>This?</p><feaas-external hydrate="false" data-external-id="test-server-external-context"><h1>My Component: cde</h1></feaas-external></feaas-component>`
125
+ `<feaas-component class="-feaas" library="library" component="test" src="library/test" hydrate="false" data="{&quot;value&quot;:0}"><p>This?</p><feaas-external hydrate="false" data-external-id="test-server-external-context"><h1>My Component: cde</h1></feaas-external></feaas-component>`
126
126
  )
127
127
  })
128
- })
128
+ })
@@ -96,6 +96,7 @@ declare global {
96
96
  interface IntrinsicElements {
97
97
  'feaas-component': {
98
98
  data?: any;
99
+ class?: string;
99
100
  suppressHydrationWarning?: boolean;
100
101
  template?: string;
101
102
  instance?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FEAASComponent.d.ts","sourceRoot":"","sources":["../../src/components/FEAASComponent.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAgB,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY;;;;;;;;;;;;;;EAkCzD;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAE1E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,cAAe,SAAQ,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC5E,SAAS,EAAE,GAAG,CAAK;IACnB,aAAa,yBAGZ;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