@knapsack/renderer-client 4.72.0--canary.4920.be98a9b.0 → 4.72.0--canary.5313.51b7b5f.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,171 @@
1
+ # v4.71.16 (Thu Dec 05 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - refactor React Renderer to use `tsc` for build [#5224](https://github.com/knapsack-labs/app-monorepo/pull/5224) ([@EvanLovely](https://github.com/EvanLovely) [@mabry1985](https://github.com/mabry1985))
6
+
7
+ #### Authors: 2
8
+
9
+ - Evan Lovely ([@EvanLovely](https://github.com/EvanLovely))
10
+ - Josh Mabry ([@mabry1985](https://github.com/mabry1985))
11
+
12
+ ---
13
+
14
+ # v4.71.13 (Wed Dec 04 2024)
15
+
16
+ #### 🐛 Bug Fix
17
+
18
+ - Merge branch 'feature/ksp-5777-gsk-sso-issues' into feature/sso-config-via-db ([@EvanLovely](https://github.com/EvanLovely))
19
+ - Merge branch 'latest' into feature/ksp-5777-gsk-sso-issues ([@illepic](https://github.com/illepic))
20
+ - Bump version to: v4.71.12 \[skip ci\] ([@KnapsackBot](https://github.com/KnapsackBot))
21
+ - Update CHANGELOG.md \[skip ci\] ([@KnapsackBot](https://github.com/KnapsackBot))
22
+ - Bump version to: v4.71.11 \[skip ci\] ([@KnapsackBot](https://github.com/KnapsackBot))
23
+ - update event listener logic ([@EvanLovely](https://github.com/EvanLovely))
24
+
25
+ #### 🏠 Internal
26
+
27
+ - refactor Cypress user login [#5225](https://github.com/knapsack-labs/app-monorepo/pull/5225) ([@EvanLovely](https://github.com/EvanLovely))
28
+ - Update Node.js to v20.18.1 [#5197](https://github.com/knapsack-labs/app-monorepo/pull/5197) ([@renovate[bot]](https://github.com/renovate[bot]))
29
+ - adds evt handlers for design src logs [#5194](https://github.com/knapsack-labs/app-monorepo/pull/5194) ([@mabry1985](https://github.com/mabry1985))
30
+ - setup login w popup [#5209](https://github.com/knapsack-labs/app-monorepo/pull/5209) ([@GormanDesign](https://github.com/GormanDesign) [@mabry1985](https://github.com/mabry1985) [@EvanLovely](https://github.com/EvanLovely) [@KnapsackBot](https://github.com/KnapsackBot) [@illepic](https://github.com/illepic))
31
+ - migrate to new Figma oAuth endpoints and configuration [#5206](https://github.com/knapsack-labs/app-monorepo/pull/5206) ([@mabry1985](https://github.com/mabry1985))
32
+
33
+ #### Authors: 6
34
+
35
+ - [@renovate[bot]](https://github.com/renovate[bot])
36
+ - Christopher Bloom ([@illepic](https://github.com/illepic))
37
+ - Evan Lovely ([@EvanLovely](https://github.com/EvanLovely))
38
+ - Josh Mabry ([@mabry1985](https://github.com/mabry1985))
39
+ - KnapsackBot ([@KnapsackBot](https://github.com/KnapsackBot))
40
+ - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
41
+
42
+ ---
43
+
44
+ # v4.71.12 (Thu Nov 21 2024)
45
+
46
+ #### 🐛 Bug Fix
47
+
48
+ - Fix component alignment in pattern stage and embeds [#5138](https://github.com/knapsack-labs/app-monorepo/pull/5138) ([@GormanDesign](https://github.com/GormanDesign))
49
+ - Merge branch 'latest' into feature/ksp-5732-fix-component-alignment-in-pattern-stage-and-embeds ([@GormanDesign](https://github.com/GormanDesign))
50
+
51
+ #### Authors: 1
52
+
53
+ - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
54
+
55
+ ---
56
+
57
+ # v4.71.10 (Thu Nov 21 2024)
58
+
59
+ #### 🐛 Bug Fix
60
+
61
+ - fix prop reordering doesnt stick [#5196](https://github.com/knapsack-labs/app-monorepo/pull/5196) ([@mabry1985](https://github.com/mabry1985))
62
+ - update event listener logic ([@EvanLovely](https://github.com/EvanLovely))
63
+
64
+ #### 🏠 Internal
65
+
66
+ - add track scroll position prop [#5205](https://github.com/knapsack-labs/app-monorepo/pull/5205) ([@mabry1985](https://github.com/mabry1985) [@EvanLovely](https://github.com/EvanLovely))
67
+
68
+ #### Authors: 2
69
+
70
+ - Evan Lovely ([@EvanLovely](https://github.com/EvanLovely))
71
+ - Josh Mabry ([@mabry1985](https://github.com/mabry1985))
72
+
73
+ ---
74
+
75
+ # v4.71.9 (Wed Nov 20 2024)
76
+
77
+ #### 🐛 Bug Fix
78
+
79
+ - restore template scroll position when updating [#5193](https://github.com/knapsack-labs/app-monorepo/pull/5193) ([@mabry1985](https://github.com/mabry1985) [@EvanLovely](https://github.com/EvanLovely))
80
+
81
+ #### 🏠 Internal
82
+
83
+ - setup TS strict mode KSP-5492 [#5183](https://github.com/knapsack-labs/app-monorepo/pull/5183) ([@EvanLovely](https://github.com/EvanLovely))
84
+
85
+ #### Authors: 2
86
+
87
+ - Evan Lovely ([@EvanLovely](https://github.com/EvanLovely))
88
+ - Josh Mabry ([@mabry1985](https://github.com/mabry1985))
89
+
90
+ ---
91
+
92
+ # v4.71.8 (Fri Nov 15 2024)
93
+
94
+ #### 🐛 Bug Fix
95
+
96
+ - Merge branch 'latest' into feature/KSP-5764-add-button-modes ([@brittanysmart](https://github.com/brittanysmart))
97
+ - Merge branch 'latest' into GormanDesign-patch-2 ([@GormanDesign](https://github.com/GormanDesign))
98
+
99
+ #### 🏠 Internal
100
+
101
+ - update gsk-digital-channels sso page content [#5178](https://github.com/knapsack-labs/app-monorepo/pull/5178) ([@GormanDesign](https://github.com/GormanDesign))
102
+ - fix figma tiles show processing message indefinitely [#5179](https://github.com/knapsack-labs/app-monorepo/pull/5179) ([@mabry1985](https://github.com/mabry1985))
103
+
104
+ #### Authors: 3
105
+
106
+ - Brittany Smart ([@brittanysmart](https://github.com/brittanysmart))
107
+ - Josh Mabry ([@mabry1985](https://github.com/mabry1985))
108
+ - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
109
+
110
+ ---
111
+
112
+ # v4.71.6 (Thu Nov 14 2024)
113
+
114
+ #### 🐛 Bug Fix
115
+
116
+ - Merge branch 'latest' into feature/ksp-5738-text-editor-block-has-stale-state ([@mabry1985](https://github.com/mabry1985))
117
+ - Merge branch 'latest' into feature/nuke-old-claims ([@illepic](https://github.com/illepic))
118
+ - Merge branch 'latest' into feature/ksp-5437-update-auth0-node-sdk ([@freneticpixel](https://github.com/freneticpixel))
119
+ - Merge branch 'latest' into feature/ksp-5710-collections-block-filters ([@GormanDesign](https://github.com/GormanDesign))
120
+ - Merge remote-tracking branch 'origin/latest' into feature/ksp-5437-update-auth0-node-sdk ([@freneticpixel](https://github.com/freneticpixel))
121
+
122
+ #### 🏠 Internal
123
+
124
+ - Update babel [#5074](https://github.com/knapsack-labs/app-monorepo/pull/5074) ([@renovate[bot]](https://github.com/renovate[bot]))
125
+ - Update dependency @types/node to ^20.17.6 [#5127](https://github.com/knapsack-labs/app-monorepo/pull/5127) ([@renovate[bot]](https://github.com/renovate[bot]))
126
+
127
+ #### Authors: 5
128
+
129
+ - [@renovate[bot]](https://github.com/renovate[bot])
130
+ - Christopher Bloom ([@illepic](https://github.com/illepic))
131
+ - Jim Frenette ([@freneticpixel](https://github.com/freneticpixel))
132
+ - Josh Mabry ([@mabry1985](https://github.com/mabry1985))
133
+ - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
134
+
135
+ ---
136
+
137
+ # v4.71.5 (Tue Nov 05 2024)
138
+
139
+ #### 🐛 Bug Fix
140
+
141
+ - Merge branch 'latest' into feature/ksp-5668-handle-figma-blocks-when-updating-design-source-file ([@GormanDesign](https://github.com/GormanDesign))
142
+
143
+ #### 🏠 Internal
144
+
145
+ - Update dependency @types/node to ^20.17.5 [#5086](https://github.com/knapsack-labs/app-monorepo/pull/5086) ([@renovate[bot]](https://github.com/renovate[bot]))
146
+ - Update dependency @react-aria/visually-hidden to ^3.8.17 [#5078](https://github.com/knapsack-labs/app-monorepo/pull/5078) ([@renovate[bot]](https://github.com/renovate[bot]))
147
+ - Update dependency @types/node to ^20.17.4 [#5080](https://github.com/knapsack-labs/app-monorepo/pull/5080) ([@renovate[bot]](https://github.com/renovate[bot]))
148
+ - Update dependency @types/node to ^20.17.3 [#5046](https://github.com/knapsack-labs/app-monorepo/pull/5046) ([@renovate[bot]](https://github.com/renovate[bot]))
149
+
150
+ #### Authors: 2
151
+
152
+ - [@renovate[bot]](https://github.com/renovate[bot])
153
+ - Matt Gorman ([@GormanDesign](https://github.com/GormanDesign))
154
+
155
+ ---
156
+
157
+ # v4.71.4 (Tue Oct 29 2024)
158
+
159
+ #### 🏠 Internal
160
+
161
+ - Update dependency @types/node to ^20.17.2 [#5020](https://github.com/knapsack-labs/app-monorepo/pull/5020) ([@renovate[bot]](https://github.com/renovate[bot]))
162
+
163
+ #### Authors: 1
164
+
165
+ - [@renovate[bot]](https://github.com/renovate[bot])
166
+
167
+ ---
168
+
1
169
  # v4.71.1 (Wed Oct 23 2024)
2
170
 
3
171
  #### 🐛 Bug Fix
@@ -1,11 +1,18 @@
1
1
  const metaTag = document.getElementById('ks-meta');
2
- const metaString = metaTag.innerText;
3
- const meta = JSON.parse(metaString);
2
+ const metaString = metaTag?.innerText;
3
+ const meta = JSON.parse(metaString ?? '{}');
4
4
  const {
5
5
  websocketsPort
6
6
  } = meta;
7
7
  // an extra check in case the meta tag is wrong
8
8
  const isReallyInIframe = window.parent !== window;
9
+
10
+ /**
11
+ * A type-safe wrapper for `window.parent.postMessage()`
12
+ */
13
+ function postMessage(message) {
14
+ window.parent.postMessage(message, '*');
15
+ }
9
16
  if (websocketsPort) {
10
17
  if ('WebSocket' in window && window.location.hostname === 'localhost') {
11
18
  const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
@@ -33,7 +40,8 @@ if (isReallyInIframe) {
33
40
  e.preventDefault();
34
41
  });
35
42
  });
36
- let timeoutId;
43
+ let resizeTimeoutId;
44
+ let scrollDebounceTimer;
37
45
 
38
46
  /**
39
47
  * Sends a message to the parent window with the current height and width of the iframe's content.
@@ -43,18 +51,66 @@ if (isReallyInIframe) {
43
51
  height,
44
52
  width
45
53
  }) {
46
- clearTimeout(timeoutId);
54
+ clearTimeout(resizeTimeoutId);
47
55
  // slight delay to prevent spamming the parent window with resize events
48
- timeoutId = setTimeout(() => {
49
- const event = {
56
+ resizeTimeoutId = setTimeout(() => {
57
+ postMessage({
50
58
  type: 'ksRendererClient.contentResized',
51
59
  // round up to the nearest pixel
52
60
  height: Math.ceil(height),
53
61
  width: Math.ceil(width)
54
- };
55
- window.parent.postMessage(event, '*');
62
+ });
56
63
  }, 100);
57
64
  }
65
+
66
+ /**
67
+ * Sends a message to the parent window with the current scroll position of the iframe's content.
68
+ */
69
+ function sendScrollEvent() {
70
+ // Clear any existing timeout
71
+ window.clearTimeout(scrollDebounceTimer);
72
+
73
+ // Set new timeout - only send position after 150ms of no scrolling
74
+ scrollDebounceTimer = window.setTimeout(() => {
75
+ const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
76
+ const scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
77
+ postMessage({
78
+ type: 'ksRendererClient.scrollPosition',
79
+ scrollTop,
80
+ scrollLeft
81
+ });
82
+ }, 150);
83
+ }
84
+ window.addEventListener('message', event => {
85
+ switch (event.data?.type) {
86
+ case 'ksRendererClient.updateScrollPosition':
87
+ {
88
+ if (document.documentElement) {
89
+ document.documentElement.scrollTop = event.data.scrollTop;
90
+ document.documentElement.scrollLeft = event.data.scrollLeft;
91
+ }
92
+ if (document.body) {
93
+ document.body.scrollTop = event.data.scrollTop;
94
+ document.body.scrollLeft = event.data.scrollLeft;
95
+ }
96
+ break;
97
+ }
98
+ default:
99
+ {
100
+ const _exhaustiveCheck = event.data?.type;
101
+ console.log('Unhandled message type:', _exhaustiveCheck);
102
+ }
103
+ }
104
+ });
105
+ window.addEventListener('scroll', sendScrollEvent, {
106
+ passive: true
107
+ });
108
+ // Send ready message when content is fully loaded
109
+ window.addEventListener('load', () => {
110
+ postMessage({
111
+ type: 'ksRendererClient.ready'
112
+ });
113
+ });
58
114
  if (ResizeObserver) {
59
115
  // watch for any changes to the content's width/height
60
116
  const resizeObserver = new ResizeObserver(entries => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@knapsack/renderer-client",
3
3
  "description": "",
4
- "version": "4.72.0--canary.4920.be98a9b.0",
4
+ "version": "4.72.0--canary.5313.51b7b5f.0",
5
5
  "type": "module",
6
6
  "main": "dist/renderer-client.mjs",
7
7
  "module": "dist/renderer-client.mjs",
@@ -23,17 +23,17 @@
23
23
  "types-test:start": "tsc --watch"
24
24
  },
25
25
  "devDependencies": {
26
- "@babel/core": "^7.25.7",
27
- "@knapsack/babel-config-starter": "4.72.0--canary.4920.be98a9b.0",
28
- "@knapsack/eslint-config-starter": "4.72.0--canary.4920.be98a9b.0",
29
- "@knapsack/types": "4.72.0--canary.4920.be98a9b.0",
30
- "@knapsack/typescript-config-starter": "4.72.0--canary.4920.be98a9b.0",
26
+ "@babel/core": "^7.26.0",
27
+ "@knapsack/babel-config-starter": "4.72.0--canary.5313.51b7b5f.0",
28
+ "@knapsack/eslint-config-starter": "4.72.0--canary.5313.51b7b5f.0",
29
+ "@knapsack/types": "4.72.0--canary.5313.51b7b5f.0",
30
+ "@knapsack/typescript-config-starter": "4.72.0--canary.5313.51b7b5f.0",
31
31
  "@rollup/plugin-babel": "^5.3.1",
32
32
  "@rollup/plugin-commonjs": "^21.1.0",
33
33
  "@rollup/plugin-json": "^4.1.0",
34
34
  "@rollup/plugin-node-resolve": "^13.3.0",
35
35
  "@rollup/plugin-replace": "^3.1.0",
36
- "@types/node": "^20.17.2",
36
+ "@types/node": "^20.17.8",
37
37
  "eslint": "^8.57.0",
38
38
  "rollup": "^2.79.1",
39
39
  "typescript": "^5.6.3"
@@ -47,5 +47,5 @@
47
47
  "directory": "apps/client/libs/renderer-client",
48
48
  "type": "git"
49
49
  },
50
- "gitHead": "be98a9b39ed70c97fd88e8359e5420250a582b6f"
50
+ "gitHead": "51b7b5f2b8e4a42f078030647178769053559d32"
51
51
  }