@sitecore-feaas/clientside 0.5.2 → 0.5.3

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/src/cdn.ts CHANGED
@@ -99,7 +99,7 @@ export function getComponentURL(props: FEAASCDNComponentProps | string) {
99
99
  }
100
100
  }
101
101
  return `${props.cdn || props.hostname || DEFAULT_CDN_URL}/components/${props.library}/${props.component}/${
102
- props.version
102
+ props.version || 'responsive'
103
103
  }/${props.revision || 'published'}.html`
104
104
  }
105
105
 
package/src/ui/react.tsx CHANGED
@@ -167,7 +167,7 @@ export function HTMLNodeToReact(
167
167
  const [k, v] = pair.split(':')
168
168
  return {
169
169
  ...object,
170
- [k]: v
170
+ [BYOC.toCamelCase(k)]: v
171
171
  }
172
172
  }, {})
173
173
  } else if (name == 'class') {
package/test/cdn.ts CHANGED
@@ -5,11 +5,28 @@ import {
5
5
  DEFAULT_CDN_URL,
6
6
  getStylesheetSource,
7
7
  parseStylesheetSource,
8
- getStylesheetURL
8
+ getStylesheetURL,
9
+ getComponentURL
9
10
  } from '../src/cdn.js'
10
11
  import { CH1Node, serializeCH1RichText } from '../src/utils/data.js'
11
12
  describe('CDN', function () {
12
13
  it('should parse and serialize component src', function () {
14
+ expect(
15
+ parseComponentSource('https://feaaslocal.blob.core.windows.net/components/2rFkpifWzZp5IEhKX4rt5raaaa/bkpRNHFB2v')
16
+ ).toEqual({
17
+ cdn: 'https://feaaslocal.blob.core.windows.net',
18
+ component: 'bkpRNHFB2v',
19
+ library: '2rFkpifWzZp5IEhKX4rt5raaaa',
20
+ revision: undefined,
21
+ version: undefined
22
+ })
23
+ expect(
24
+ getComponentURL({
25
+ src: 'https://feaaslocal.blob.core.windows.net/components/2rFkpifWzZp5IEhKX4rt5raaaa/bkpRNHFB2v'
26
+ })
27
+ ).toEqual(
28
+ 'https://feaaslocal.blob.core.windows.net/components/2rFkpifWzZp5IEhKX4rt5raaaa/bkpRNHFB2v/responsive/published.html'
29
+ )
13
30
  ;[
14
31
  'library/component',
15
32
  'cdn/components/library/component',
@@ -18,7 +35,8 @@ describe('CDN', function () {
18
35
  'cdn/components/library/component/version',
19
36
  'cdn/components/library/component/version/1',
20
37
  'library/component/version/1',
21
- 'https://feaaslocal.blob.core.windows.net/components/library/component/version/1'
38
+ 'https://feaaslocal.blob.core.windows.net/components/library/component/version/1',
39
+ 'https://feaaslocal.blob.core.windows.net/components/2rFkpifWzZp5IEhKX4rt5raaaa/bkpRNHFB2v'
22
40
  ].forEach((expression) => {
23
41
  expect(getComponentSource(parseComponentSource(expression))).toEqual(expression)
24
42
  })
@@ -4,7 +4,7 @@ import { FEAASElement } from '../components/FEAASElement.js';
4
4
  export declare function FEAASPickerProps(element: FEAASElement<any, any>): {
5
5
  part: string;
6
6
  slot: string;
7
- mode: "library" | "context" | "datasources" | "versions" | "element" | "themes" | "overview" | "attributes";
7
+ mode: "library" | "context" | "datasources" | "versions" | "element" | "themes" | "overview" | "attributes" | "responsive-bundles";
8
8
  dialog: string;
9
9
  placeholder: string;
10
10
  frontend: string;
@@ -22,7 +22,7 @@ export declare class FEAASPicker extends FEAASElement<FEAASPickerProps, typeof F
22
22
  defaultProps: Partial<{
23
23
  part: string;
24
24
  slot: string;
25
- mode: "library" | "context" | "datasources" | "versions" | "element" | "themes" | "overview" | "attributes";
25
+ mode: "library" | "context" | "datasources" | "versions" | "element" | "themes" | "overview" | "attributes" | "responsive-bundles";
26
26
  dialog: string;
27
27
  placeholder: string;
28
28
  frontend: string;
@@ -37,7 +37,7 @@ export declare class FEAASPicker extends FEAASElement<FEAASPickerProps, typeof F
37
37
  getProps(): {
38
38
  part: string;
39
39
  slot: string;
40
- mode: "library" | "context" | "datasources" | "versions" | "element" | "themes" | "overview" | "attributes";
40
+ mode: "library" | "context" | "datasources" | "versions" | "element" | "themes" | "overview" | "attributes" | "responsive-bundles";
41
41
  dialog: string;
42
42
  placeholder: string;
43
43
  frontend: string;