@financial-times/custom-code-component 2.0.1-alpha.9 → 2.0.1-beta.10

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.
Files changed (32) hide show
  1. package/dist/CustomCodeComponent.js +7 -0
  2. package/dist/CustomCodeComponent.js.map +1 -0
  3. package/dist/custom-element.d.ts +114 -0
  4. package/dist/{index.js → custom-element.js} +211 -200
  5. package/dist/custom-element.js.map +1 -0
  6. package/dist/{webcomponent/src/index.d.ts → index.d.ts} +3 -1
  7. package/package.json +11 -6
  8. package/src/custom-code-component.css +11 -0
  9. package/src/custom-code-component.ts +133 -89
  10. package/src/environment.ts +31 -40
  11. package/src/errors.ts +8 -4
  12. package/src/events.ts +1 -1
  13. package/src/path.ts +20 -23
  14. package/dist/index.js.map +0 -1
  15. package/dist/webcomponent/src/custom-code-component.d.ts +0 -55
  16. package/dist/webcomponent/src/environment.d.ts +0 -15
  17. package/dist/webcomponent/src/errors.d.ts +0 -27
  18. package/dist/webcomponent/src/events.d.ts +0 -10
  19. package/dist/webcomponent/src/get-trace.d.ts +0 -8
  20. package/dist/webcomponent/src/logger.d.ts +0 -20
  21. package/dist/webcomponent/src/path.d.ts +0 -23
  22. package/dist/webcomponent/src/tracking.d.ts +0 -32
  23. package/dist/webcomponent/src/util.d.ts +0 -33
  24. package/dist/webcomponent/test/environment.test.d.ts +0 -1
  25. package/dist/webcomponent/test/error-handling.test.d.ts +0 -8
  26. package/dist/webcomponent/test/example.d.ts +0 -11
  27. package/dist/webcomponent/test/generate-readable-stream.d.ts +0 -8
  28. package/dist/webcomponent/test/path.test.d.ts +0 -5
  29. package/dist/webcomponent/test/ssr.test.d.ts +0 -4
  30. package/dist/webcomponent/test/utils.test.d.ts +0 -1
  31. package/dist/webcomponent/vite.config.d.ts +0 -2
  32. package/dist/webcomponent/vitest.config.d.ts +0 -2
@@ -1,33 +0,0 @@
1
- /**
2
- * Used to convert camelCase to kebab-case
3
- * @param str
4
- * @returns
5
- */
6
- export declare const kebabize: (str: string) => string;
7
- /**
8
- * Checks if the provided host is part of the allowed test environments.
9
- *
10
- * @param host - The hostname to check.
11
- * @returns True if the hostname is a safe test environment, false otherwise.
12
- */
13
- export declare function isSafeTestEnv(host: string | undefined): boolean;
14
- /**
15
- * Checks if the current window location hostname is considered a local environment.
16
- *
17
- * @returns True if the hostname is local, false otherwise.
18
- */
19
- export declare function isLocalEnv(): boolean;
20
- /**
21
- * Checks if the current window location host is one of the Spark environments.
22
- *
23
- * @returns True if the host is spark.ft.com or spark-staging.ft.com, false otherwise.
24
- */
25
- export declare function isSparkEnv(): boolean;
26
- /**
27
- * Checks if the given hostname is in the provided allowlist.
28
- *
29
- * @param allowlist - A list of allowed hostnames or RegExp matchers.
30
- * @param hostname - The hostname to validate.
31
- * @returns True if the hostname matches any item in the allowlist, false otherwise.
32
- */
33
- export declare function isAllowed(allowlist: (string | RegExp)[], hostname: string | undefined): boolean;
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * @file
3
- * Unit test for web component error handling
4
- */
5
- export declare const worker: import("msw/browser").SetupWorker;
6
- export declare const it: import("vitest").TestAPI<{
7
- worker: import("msw/browser").SetupWorker;
8
- }>;
@@ -1,11 +0,0 @@
1
- import { ReactRenderer } from "../../ccc-sdk/src/renderers/react/ReactRenderer";
2
- export declare const renderer: ReactRenderer;
3
- declare const _default: (shadowRoot: ShadowRoot, attrs: any, ssr?: boolean) => {
4
- unmount: (root: any) => void;
5
- onmessage: {
6
- (...data: any[]): void;
7
- (message?: any, ...optionalParams: any[]): void;
8
- };
9
- ready: Promise<void>;
10
- };
11
- export default _default;
@@ -1,8 +0,0 @@
1
- import { BaseRenderer } from "~sdk/renderers/BaseRenderer";
2
- export declare const generateReadableStream: ({ framework, props, renderer, }: {
3
- framework: string;
4
- renderer: BaseRenderer;
5
- props: {
6
- [key: string]: any;
7
- };
8
- }) => Promise<Response>;
@@ -1,5 +0,0 @@
1
- /**
2
- * @file
3
- * Unit tests for the ComponentPath module
4
- */
5
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * @file
3
- * Integration testing for server-side rendering
4
- */
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;