@kubohiroya/turbowarp-extension-data-editor 0.6.0 → 0.8.0

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/dist/react.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import bindBlockEditorFieldErrors from './field-errors.js';
2
+ import { attachEditorDialogWindow } from './dialog-window.js';
2
3
  export { default as bindBlockEditorFieldErrors } from './field-errors.js';
3
4
  import * as React from 'react';
4
5
  import { BlockEditorConflictError } from './types.js';
@@ -164,18 +165,19 @@ export class BlockEditorDialog extends React.Component {
164
165
  this.mountBody();
165
166
  }
166
167
  componentWillUnmount() {
167
- var _a, _b, _c, _d;
168
+ var _a, _b, _c, _d, _e;
168
169
  this.unmounting = true;
169
170
  this.mounted = false;
170
171
  if (this.focusFrame !== undefined)
171
172
  cancelAnimationFrame(this.focusFrame);
172
173
  this.removeListener();
173
174
  (_a = this.stopFieldErrors) === null || _a === void 0 ? void 0 : _a.call(this);
175
+ (_b = this.stopWindow) === null || _b === void 0 ? void 0 : _b.call(this);
174
176
  try {
175
- (_b = this.unmountBody) === null || _b === void 0 ? void 0 : _b.call(this);
177
+ (_c = this.unmountBody) === null || _c === void 0 ? void 0 : _c.call(this);
176
178
  }
177
179
  catch (error) {
178
- (_d = (_c = this.props).onError) === null || _d === void 0 ? void 0 : _d.call(_c, error);
180
+ (_e = (_d = this.props).onError) === null || _e === void 0 ? void 0 : _e.call(_d, error);
179
181
  }
180
182
  finally {
181
183
  this.props.session.dispose();
@@ -185,6 +187,12 @@ export class BlockEditorDialog extends React.Component {
185
187
  if (!this.body || this.unmountBody || this.state.mountFailed)
186
188
  return;
187
189
  try {
190
+ if (!this.stopWindow)
191
+ this.stopWindow = attachEditorDialogWindow(this.body, {
192
+ headerClassName: this.props.styles.header,
193
+ maximize: this.props.messages.maximize,
194
+ restore: this.props.messages.restore
195
+ });
188
196
  if (!this.stopFieldErrors)
189
197
  this.stopFieldErrors = bindBlockEditorFieldErrors(this.body);
190
198
  if (typeof this.props.session.getNodes !== 'function')
@@ -224,7 +232,7 @@ export class BlockEditorDialog extends React.Component {
224
232
  /ブロック|block/i.test(messages.title) ? messages.title.replace(/ブロック|block/i, () => name) :
225
233
  `${name}: ${messages.title}` : messages.title;
226
234
  return React.createElement(ModalComponent, { className: `${styles.modalContent || ''} ${hierarchy ? styles.hierarchyModal : ''} ${this.props.className || ''}`, contentLabel: title, ...((appearance === null || appearance === void 0 ? void 0 : appearance.iconURI) ? { headerImage: appearance.iconURI } : {}), headerClassName: styles.header, id: "blockEditorModal", onRequestClose: this.handleClose },
227
- React.createElement("div", { "aria-busy": saving, className: styles.body, onCompositionStart: () => { this.composing = true; }, onCompositionEnd: () => { this.composing = false; }, onKeyDownCapture: event => {
235
+ React.createElement("div", { "aria-busy": saving, className: styles.body, "data-block-editor-body": "", onCompositionStart: () => { this.composing = true; }, onCompositionEnd: () => { this.composing = false; }, onKeyDownCapture: event => {
228
236
  if (this.composing || event.nativeEvent.isComposing || event.keyCode === 229)
229
237
  event.stopPropagation();
230
238
  } },