@optiaxiom/proteus 0.2.8 → 0.2.9

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.
@@ -94,6 +94,10 @@ function ProteusDocumentShell({
94
94
  } else {
95
95
  await Promise.all(urls.map((u) => downloadFile(u)));
96
96
  }
97
+ } else if (event.action === "openLink") {
98
+ if (typeof event.url === "string") {
99
+ window.open(event.url, "_blank", "noopener,noreferrer");
100
+ }
97
101
  }
98
102
  return;
99
103
  }),
@@ -2875,6 +2875,33 @@ var definitions = {
2875
2875
  "url"
2876
2876
  ],
2877
2877
  type: "object"
2878
+ },
2879
+ {
2880
+ additionalProperties: false,
2881
+ description: "Client-side component action - for opening a link in a new tab",
2882
+ properties: {
2883
+ action: {
2884
+ "const": "openLink",
2885
+ description: "The action type",
2886
+ type: "string"
2887
+ },
2888
+ url: {
2889
+ anyOf: [
2890
+ {
2891
+ $ref: "#/definitions/ProteusExpression"
2892
+ },
2893
+ {
2894
+ type: "string"
2895
+ }
2896
+ ],
2897
+ description: "URL to open in a new tab"
2898
+ }
2899
+ },
2900
+ required: [
2901
+ "action",
2902
+ "url"
2903
+ ],
2904
+ type: "object"
2878
2905
  }
2879
2906
  ],
2880
2907
  description: "Handler for user interactions - a server-side interaction call, client-side message, or client-side component action"
@@ -2860,6 +2860,32 @@ var definitions = {
2860
2860
  "url"
2861
2861
  ],
2862
2862
  type: "object"
2863
+ },
2864
+ {
2865
+ description: "Client-side component action - for opening a link in a new tab",
2866
+ properties: {
2867
+ action: {
2868
+ "const": "openLink",
2869
+ description: "The action type",
2870
+ type: "string"
2871
+ },
2872
+ url: {
2873
+ anyOf: [
2874
+ {
2875
+ $ref: "#/definitions/ProteusExpression"
2876
+ },
2877
+ {
2878
+ type: "string"
2879
+ }
2880
+ ],
2881
+ description: "URL to open in a new tab"
2882
+ }
2883
+ },
2884
+ required: [
2885
+ "action",
2886
+ "url"
2887
+ ],
2888
+ type: "object"
2863
2889
  }
2864
2890
  ],
2865
2891
  description: "Handler for user interactions - a server-side interaction call, client-side message, or client-side component action"
package/dist/index.d.ts CHANGED
@@ -320,6 +320,11 @@ type ProteusEventHandler = {
320
320
  url: (ProteusValueProps & {
321
321
  $type: "Value";
322
322
  }) | string | string[];
323
+ } | {
324
+ action: "openLink";
325
+ url: (ProteusValueProps & {
326
+ $type: "Value";
327
+ }) | string;
323
328
  } | {
324
329
  interaction: string;
325
330
  params?: Record<string, unknown>;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "git+https://github.com/optimizely-axiom/optiaxiom.git"
8
8
  },
9
9
  "type": "module",
10
- "version": "0.2.8",
10
+ "version": "0.2.9",
11
11
  "files": [
12
12
  "dist/**",
13
13
  "LICENSE"
@@ -39,8 +39,8 @@
39
39
  "embla-carousel-react": "^8.6.0",
40
40
  "jsonpointer": "^5.0.1",
41
41
  "recharts": "^3.8.1",
42
- "@optiaxiom/react": "^1.9.32",
43
- "@optiaxiom/icons": "^1.1.2"
42
+ "@optiaxiom/icons": "^1.1.2",
43
+ "@optiaxiom/react": "^1.9.32"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@emotion/hash": "^0.9.2",