@openfin/web-utils 0.38.8 → 0.38.22

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.
@@ -4,6 +4,7 @@ declare const mixin: (Base: typeof HTMLElement) => {
4
4
  "__#1@#iframe": HTMLIFrameElement;
5
5
  brokerUrl: string | null;
6
6
  name: string | null;
7
+ forceFrameName: string | null;
7
8
  uuid: string | null;
8
9
  src: string | null;
9
10
  providerId: string | null;
@@ -323,14 +324,18 @@ declare const mixin: (Base: typeof HTMLElement) => {
323
324
  export type OfViewAttributes = {
324
325
  'of-context-group'?: string;
325
326
  'of-provider-id'?: string;
326
- 'src': string;
327
327
  'of-uuid': string;
328
328
  'of-name': string;
329
329
  'of-broker'?: string;
330
+ 'forceFrameName'?: string;
331
+ 'src': string;
330
332
  };
331
333
  type OfViewElementConstructor = ReturnType<typeof mixin>;
332
334
  export type OfViewElement = OfViewElementConstructor extends {
333
335
  new (): infer T;
334
336
  } ? T : never;
335
337
  export declare const registerOfViewElement: () => void;
336
- export {};
338
+ declare class OfViewElementFactory {
339
+ static create(attributes: OfViewAttributes): OfViewElement;
340
+ }
341
+ export { OfViewElementFactory };
@@ -12,13 +12,19 @@ const mixin = (Base) => class _OfViewElement extends Base {
12
12
  this.#iframe.src = this.src;
13
13
  this.#iframe.style.height = '100%';
14
14
  this.#iframe.style.width = '100%';
15
- this.#iframe.setAttribute('name', encodeOptions({
16
- brokerUrl: this.brokerUrl,
17
- name: this.name,
18
- uuid: this.uuid,
19
- providerId: this.providerId,
20
- contextGroup: this.contextGroup
21
- }, 'of-frame'));
15
+ if (this.forceFrameName) {
16
+ // if forceFrameName is set, the consumer is intentionally breaking auto-connection
17
+ this.#iframe.setAttribute('name', this.forceFrameName);
18
+ }
19
+ else {
20
+ this.#iframe.setAttribute('name', encodeOptions({
21
+ brokerUrl: this.brokerUrl,
22
+ name: this.name,
23
+ uuid: this.uuid,
24
+ providerId: this.providerId,
25
+ contextGroup: this.contextGroup
26
+ }, 'of-frame'));
27
+ }
22
28
  this.#iframe.setAttribute('id', this.name);
23
29
  this.appendChild(this.#iframe);
24
30
  }
@@ -40,6 +46,14 @@ const mixin = (Base) => class _OfViewElement extends Base {
40
46
  this.setAttribute('of-name', val);
41
47
  }
42
48
  }
49
+ get forceFrameName() {
50
+ return this.getAttribute('forceFrameName');
51
+ }
52
+ set forceFrameName(val) {
53
+ if (val) {
54
+ this.setAttribute('forceFrameName', val);
55
+ }
56
+ }
43
57
  get uuid() {
44
58
  return this.getAttribute('of-uuid');
45
59
  }
@@ -77,3 +91,13 @@ const mixin = (Base) => class _OfViewElement extends Base {
77
91
  }
78
92
  };
79
93
  export const registerOfViewElement = () => customElements.define('of-view', mixin(HTMLElement));
94
+ class OfViewElementFactory {
95
+ static create(attributes) {
96
+ const ofView = document.createElement('of-view');
97
+ Object.entries(attributes).forEach(([key, value]) => {
98
+ ofView.setAttribute(key, value);
99
+ });
100
+ return ofView;
101
+ }
102
+ }
103
+ export { OfViewElementFactory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/web-utils",
3
- "version": "0.38.8",
3
+ "version": "0.38.22",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "files": [
@@ -21,24 +21,14 @@
21
21
  "predev": "rimraf out",
22
22
  "build": "tsc",
23
23
  "dev": "tsc --sourcemap --skipLibCheck",
24
- "watch": "npm run dev -- --watch"
24
+ "watch": "npm run dev -- --watch",
25
+ "ci:prepublish": "of-npm prepublish",
26
+ "ci:postpublish": "of-npm postpublish",
27
+ "ci:publish": "npm publish"
25
28
  },
26
29
  "author": "",
27
30
  "license": "SEE LICENSE IN LICENSE.md",
28
31
  "dependencies": {
29
32
  "uuid": "8.3.2"
30
- },
31
- "devDependencies": {
32
- "@openfin/core-ci-tools": "0.0.1",
33
- "@rollup/plugin-commonjs": "25.0.2",
34
- "@rollup/plugin-typescript": "11.1.1",
35
- "@types/uuid": "^8.3.4",
36
- "jsdom": "^22.1.0",
37
- "rimraf": "5.0.1",
38
- "rollup": "3.24.1",
39
- "ts-loader": "9.5.0",
40
- "typescript": "4.9.5",
41
- "vitest": "0.32.2",
42
- "webpack": "5.89.0"
43
33
  }
44
- }
34
+ }