@tinymce/tinymce-webcomponent 2.0.0 → 2.0.1-feature.20220720005119959.sha52d4b55

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## Unreleased
8
+ ### Fixed
9
+ - Find an associated form even when in a nested shadow DOM.
10
+
7
11
  ## 2.0.0
8
12
  ### Changed
9
13
  - License changed to MIT (from Apache 2) this matches TinyMCE 6 license
@@ -91,6 +91,17 @@
91
91
  Status[Status['Initializing'] = 1] = 'Initializing';
92
92
  Status[Status['Ready'] = 2] = 'Ready';
93
93
  }(Status || (Status = {})));
94
+ const closestRecursive = (selector, element) => {
95
+ const found = element.closest(selector);
96
+ if (found !== null) {
97
+ return found;
98
+ }
99
+ const next = element.getRootNode().host;
100
+ if (next !== null && next !== undefined) {
101
+ return closestRecursive(selector, next);
102
+ }
103
+ return null;
104
+ };
94
105
  const isLookupKey = (values, key) => has(values, key);
95
106
  const lookup = values => key => isLookupKey(values, key) ? values[key] : key;
96
107
  const parseGlobal = resolve;
@@ -254,7 +265,7 @@
254
265
  _updateForm() {
255
266
  if (this.isConnected) {
256
267
  const formId = this.getAttribute('form');
257
- const form = formId !== null ? this.ownerDocument.querySelector('form#' + formId) : this.closest('form');
268
+ const form = formId !== null ? this.ownerDocument.querySelector('form#' + formId) : closestRecursive('form', this);
258
269
  if (this._form !== form) {
259
270
  if (this._form !== null) {
260
271
  this._form.removeEventListener('formdata', this._formDataHandler);
package/package.json CHANGED
@@ -25,30 +25,30 @@
25
25
  "devDependencies": {
26
26
  "@ephox/agar": "^7.0.1",
27
27
  "@ephox/bedrock-client": "^13.0.0",
28
- "@ephox/bedrock-server": "^13.1.0",
28
+ "@ephox/bedrock-server": "^13.2.1",
29
29
  "@ephox/katamari": "^9.0.1",
30
30
  "@ephox/sugar": "^9.0.1",
31
31
  "@ephox/swag": "^4.5.0",
32
- "@tinymce/beehive-flow": "^0.17.0",
32
+ "@tinymce/beehive-flow": "^0.18.0",
33
33
  "@tinymce/eslint-plugin": "^2.0.1",
34
34
  "@types/esm": "^3.2.0",
35
35
  "@types/express": "^4.17.13",
36
- "@types/node": "^17.0.22",
37
- "@typescript-eslint/eslint-plugin": "^5.16.0",
38
- "@typescript-eslint/parser": "^5.16.0",
39
- "eslint": "^8.11.0",
40
- "eslint-plugin-import": "^2.25.4",
36
+ "@types/node": "^17.0.40",
37
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
38
+ "@typescript-eslint/parser": "^5.27.0",
39
+ "eslint": "^8.17.0",
40
+ "eslint-plugin-import": "^2.26.0",
41
41
  "eslint-plugin-prefer-arrow": "^1.2.3",
42
42
  "esm": "^3.2.25",
43
- "express": "^4.17.3",
44
- "rollup": "^2.70.1",
45
- "tinymce": "^6.0.0",
46
- "ts-loader": "^9.2.8",
47
- "ts-node": "^10.7.0",
48
- "typescript": "~4.6.2",
49
- "webpack": "^5.70.0"
43
+ "express": "^4.18.1",
44
+ "rollup": "^2.75.5",
45
+ "tinymce": "^6.0.3",
46
+ "ts-loader": "^9.3.0",
47
+ "ts-node": "^10.8.1",
48
+ "typescript": "~4.7.3",
49
+ "webpack": "^5.73.0"
50
50
  },
51
51
  "dependencies": {},
52
- "version": "2.0.0",
52
+ "version": "2.0.1-feature.20220720005119959.sha52d4b55",
53
53
  "name": "@tinymce/tinymce-webcomponent"
54
54
  }