@sitecore-feaas/clientside 0.1.32 → 0.1.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-feaas/clientside",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "scripts": {
5
5
  "start": "webpack serve --open",
6
6
  "build": "rm -rf dist;npm run types; npm run build:esbuild; npm run build:sourcemaps",
@@ -26,18 +26,17 @@
26
26
  ".": {
27
27
  "localhost": "./build/ui/index.js",
28
28
  "types": "./types/ui/index.d.ts",
29
+ "typescript": "./build/ui/index.js",
29
30
  "browser": "./dist/browser/index.esm.js",
30
31
  "import": "./dist/node/index.esm.js",
31
32
  "require": "./dist/node/index.js",
32
33
  "default": "./dist/node/index.esm.js"
33
34
  },
34
- "./server": {
35
- "import": "./dist/node/index.esm.js",
36
- "default": "./dist/node/index.js"
37
- },
38
35
  "./headless": {
39
36
  "localhost": "./build/headless.js",
37
+ "development": "./build/headless.js",
40
38
  "types": "./types/headless.d.ts",
39
+ "typescript": "./build/headless.js",
41
40
  "browser": "./dist/browser/headless.esm.js",
42
41
  "import": "./dist/node/headless.esm.js",
43
42
  "require": "./dist/node/headless.js",
@@ -45,7 +44,9 @@
45
44
  },
46
45
  "./react": {
47
46
  "localhost": "./build/react.js",
47
+ "development": "./build/react.js",
48
48
  "types": "./types/react.d.ts",
49
+ "typescript": "./build/react.js",
49
50
  "browser": "./dist/browser/react.esm.js",
50
51
  "import": "./dist/node/react.esm.js",
51
52
  "require": "./dist/node/react.js",
package/src/cdn.ts CHANGED
@@ -57,7 +57,7 @@ export function getComponentSource(props: FEAASCDNComponentParams) {
57
57
  ? ''
58
58
  : props.version
59
59
  }/${!props.revision || props.revision == 'published' ? '' : props.revision}`.replace(
60
- /(^\/|\/$|(?<!:)\/\/)(?!.+\/components\/)/g,
60
+ /(^\/|\/$|\/\/)(?!.+\/components\/)/g,
61
61
  ''
62
62
  )
63
63
  }
@@ -65,7 +65,7 @@ export function getComponentSource(props: FEAASCDNComponentParams) {
65
65
  export function getStylesheetSource(props: FEAASCDNStylesheetParams) {
66
66
  return `${props.cdn && props.cdn != DEFAULT_CDN_URL ? `${props.cdn}/styles` : ''}/${props.library}/${
67
67
  props.revision == 'published' ? '' : props.revision
68
- }`.replace(/^\/|\/$|(?<!:)\/\//g, '')
68
+ }`.replace(/\/$|\/\/(?!.+\/styles\/)/g, '')
69
69
  }
70
70
 
71
71
  export function parseStylesheetSource(source: string): FEAASCDNStylesheetParams {
package/src/ui/react.tsx CHANGED
@@ -5,3 +5,4 @@ import React from 'react'
5
5
  export function FEAASEmbed({ data, ...props }: FEAASComponentProps & { src: string }) {
6
6
  return <feaas-component {...props} data={data ? JSON.stringify(data) : null} />
7
7
  }
8
+ export const Component = FEAASEmbed
package/test/cdn.ts CHANGED
@@ -37,6 +37,9 @@ describe('CDN', function () {
37
37
  expect(
38
38
  getComponentSource(parseComponentSource(DEFAULT_CDN_URL + '/components/library/component/version/1.html'))
39
39
  ).toEqual('library/component/version/1')
40
+ expect(getComponentSource(parseComponentSource('//cdn/components/library/component/version/1.html'))).toEqual(
41
+ '//cdn/components/library/component/version/1'
42
+ )
40
43
  expect(
41
44
  getComponentSource(
42
45
  parseComponentSource(DEFAULT_CDN_URL + '/components/library/component/responsive/published.html')
@@ -49,6 +52,9 @@ describe('CDN', function () {
49
52
  parseStylesheetSource('https://feaaslocal.blob.core.windows.net/styles/clean-demo/published.css')
50
53
  )
51
54
  ).toEqual('https://feaaslocal.blob.core.windows.net/styles/clean-demo')
55
+ expect(
56
+ getStylesheetSource(parseStylesheetSource('//feaaslocal.blob.core.windows.net/styles/clean-demo/published.css'))
57
+ ).toEqual('//feaaslocal.blob.core.windows.net/styles/clean-demo')
52
58
  expect(getStylesheetURL('https://feaaslocal.blob.core.windows.net/styles/clean-demo')).toEqual(
53
59
  'https://feaaslocal.blob.core.windows.net/styles/clean-demo/published.css'
54
60
  )