@harbour-enterprises/superdoc 0.12.36-next.1 → 0.12.36-next.3
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/chunks/{index-Dsg_Fwfp.cjs → index-B1MhwjTC.cjs} +2 -2
- package/dist/chunks/{index-O7So9dPw.es.js → index-BrSjd1Id.es.js} +1 -1
- package/dist/chunks/{index-6-GlnZRv.cjs → index-CMBtuT02.cjs} +1 -1
- package/dist/chunks/{index-BxV_npYq.es.js → index-SKpROzLW.es.js} +2 -2
- package/dist/chunks/{super-editor.es-BgGd5JMJ.cjs → super-editor.es-C0CYAawq.cjs} +65 -10
- package/dist/chunks/{super-editor.es-97KMYuev.es.js → super-editor.es-CJ7JYnTb.es.js} +65 -10
- package/dist/chunks/{url-C0Uy3mGF.es.js → url-CAZQTNP3.es.js} +1 -1
- package/dist/chunks/{url-CrApKLrN.cjs → url-DuggQ5JR.cjs} +1 -1
- package/dist/chunks/{xml-js-0gk9Cp_o.cjs → xml-js-B7Vccv2s.cjs} +93 -86
- package/dist/chunks/{xml-js-BsXb2vLz.es.js → xml-js-BV-kCPOA.es.js} +93 -86
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CgDrYGaI.js → converter-CgZg2BnJ.js} +3 -8
- package/dist/super-editor/chunks/{docx-zipper-CKPolIhW.js → docx-zipper-af8QSGql.js} +1 -1
- package/dist/super-editor/chunks/{editor-BWF8HE4W.js → editor-DsMCF0TV.js} +64 -4
- package/dist/super-editor/chunks/{toolbar-BH-Alf-j.js → toolbar-n4Ej7u3_.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/helpers/annotator.d.ts +2 -0
- package/dist/super-editor/core/helpers/annotator.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts +3 -3
- package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts.map +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +5 -5
- package/dist/superdoc.es.js +6 -6
- package/dist/superdoc.umd.js +66 -11
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jszip = require("./jszip-Bwu_om3F.cjs");
|
|
3
3
|
const vue = require("./vue-DPZkajuO.cjs");
|
|
4
|
-
const xmlJs = require("./xml-js-
|
|
5
|
-
const url = require("./url-
|
|
4
|
+
const xmlJs = require("./xml-js-B7Vccv2s.cjs");
|
|
5
|
+
const url = require("./url-DuggQ5JR.cjs");
|
|
6
6
|
function _mergeNamespaces(n, m) {
|
|
7
7
|
for (var i = 0; i < m.length; i++) {
|
|
8
8
|
const e = m[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getDefaultExportFromCjs } from "./jszip-BmWWPxfF.es.js";
|
|
2
|
-
import { s as streamHttp, r as require$$1 } from "./index-
|
|
2
|
+
import { s as streamHttp, r as require$$1 } from "./index-SKpROzLW.es.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
for (var i = 0; i < m.length; i++) {
|
|
5
5
|
const e = m[i];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as commonjsGlobal, B as Buffer, a as getAugmentedNamespace, g as getDefaultExportFromCjs } from "./jszip-BmWWPxfF.es.js";
|
|
2
2
|
import { p as process$1 } from "./vue-IIIZMHTg.es.js";
|
|
3
|
-
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-
|
|
4
|
-
import { u as url } from "./url-
|
|
3
|
+
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-BV-kCPOA.es.js";
|
|
4
|
+
import { u as url } from "./url-CAZQTNP3.es.js";
|
|
5
5
|
function _mergeNamespaces(n, m) {
|
|
6
6
|
for (var i = 0; i < m.length; i++) {
|
|
7
7
|
const e = m[i];
|
|
@@ -22055,12 +22055,7 @@ const getParagraphIndent = (node2, docx, styleId = "") => {
|
|
|
22055
22055
|
return indent;
|
|
22056
22056
|
};
|
|
22057
22057
|
const getParagraphSpacing = (node2, docx, styleId = "", marks = []) => {
|
|
22058
|
-
const spacing = {
|
|
22059
|
-
lineSpaceAfter: 0,
|
|
22060
|
-
lineSpaceBefore: 0,
|
|
22061
|
-
line: 0,
|
|
22062
|
-
lineRule: null
|
|
22063
|
-
};
|
|
22058
|
+
const spacing = {};
|
|
22064
22059
|
const { spacing: pDefaultSpacing = {} } = getDefaultParagraphStyle(docx, styleId);
|
|
22065
22060
|
let lineSpaceAfter, lineSpaceBefore, line, lineRuleStyle;
|
|
22066
22061
|
const pPr = node2.elements?.find((el) => el.name === "w:pPr");
|
|
@@ -23309,7 +23304,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23309
23304
|
return;
|
|
23310
23305
|
}
|
|
23311
23306
|
}
|
|
23312
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.36-next.
|
|
23307
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.36-next.3") {
|
|
23313
23308
|
const customLocation = "docProps/custom.xml";
|
|
23314
23309
|
if (!docx[customLocation]) {
|
|
23315
23310
|
docx[customLocation] = generateCustomXml();
|
|
@@ -23776,7 +23771,7 @@ function storeSuperdocVersion(docx) {
|
|
|
23776
23771
|
function generateCustomXml() {
|
|
23777
23772
|
return DEFAULT_CUSTOM_XML;
|
|
23778
23773
|
}
|
|
23779
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.12.36-next.
|
|
23774
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.12.36-next.3") {
|
|
23780
23775
|
return {
|
|
23781
23776
|
type: "element",
|
|
23782
23777
|
name: "property",
|
|
@@ -40236,6 +40231,65 @@ const deleteHeaderFooterFieldAnnotations = ({ editor, fieldIdOrArray }) => {
|
|
|
40236
40231
|
);
|
|
40237
40232
|
});
|
|
40238
40233
|
};
|
|
40234
|
+
const cleanUpListsWithAnnotations = (fieldsToDelete = [], editor) => {
|
|
40235
|
+
if (!Array.isArray(fieldsToDelete)) fieldsToDelete = [fieldsToDelete];
|
|
40236
|
+
const { doc: doc2 } = editor.state;
|
|
40237
|
+
const docxAnnotations = getAllFieldAnnotations(editor.state) || [];
|
|
40238
|
+
const nodesToDelete = [];
|
|
40239
|
+
fieldsToDelete.forEach((fieldId) => {
|
|
40240
|
+
const matched = docxAnnotations.find((a) => a.node.attrs.fieldId === fieldId);
|
|
40241
|
+
if (!matched) return;
|
|
40242
|
+
const listItem = findParentNodeClosestToPos(
|
|
40243
|
+
doc2.resolve(matched.pos),
|
|
40244
|
+
(node22) => node22.type.name === "listItem"
|
|
40245
|
+
);
|
|
40246
|
+
if (!listItem) return;
|
|
40247
|
+
if (listItem.node.childCount !== 1) {
|
|
40248
|
+
let remainingNodes = listItem.node.childCount;
|
|
40249
|
+
let matchingNodesFound = 0;
|
|
40250
|
+
let hasOtherNodes = false;
|
|
40251
|
+
listItem.node.children.forEach((child, index2) => {
|
|
40252
|
+
const { type: type2 } = child;
|
|
40253
|
+
if (type2.name !== "paragraph") return;
|
|
40254
|
+
child.children.forEach((inline) => {
|
|
40255
|
+
const isFieldToDelete = fieldsToDelete.includes(inline.attrs.fieldId);
|
|
40256
|
+
const isMatchingField = inline.type.name === "fieldAnnotation" && isFieldToDelete;
|
|
40257
|
+
const isEmpty2 = inline.childCount === 0;
|
|
40258
|
+
if (!isEmpty2 && !isMatchingField) hasOtherNodes = true;
|
|
40259
|
+
if (isMatchingField) matchingNodesFound += 1;
|
|
40260
|
+
});
|
|
40261
|
+
});
|
|
40262
|
+
if (!hasOtherNodes && matchingNodesFound > 0) {
|
|
40263
|
+
remainingNodes -= matchingNodesFound;
|
|
40264
|
+
}
|
|
40265
|
+
if (remainingNodes > 0) {
|
|
40266
|
+
return;
|
|
40267
|
+
}
|
|
40268
|
+
}
|
|
40269
|
+
let { pos, node: node2, depth } = listItem;
|
|
40270
|
+
let $pos = doc2.resolve(pos);
|
|
40271
|
+
while (depth > 0) {
|
|
40272
|
+
const parent = $pos.node(depth - 1);
|
|
40273
|
+
if (parent.childCount === 1) {
|
|
40274
|
+
depth -= 1;
|
|
40275
|
+
pos = $pos.before(depth);
|
|
40276
|
+
node2 = parent;
|
|
40277
|
+
$pos = doc2.resolve(pos);
|
|
40278
|
+
} else {
|
|
40279
|
+
break;
|
|
40280
|
+
}
|
|
40281
|
+
}
|
|
40282
|
+
if (!nodesToDelete.some((n) => n.pos === pos)) {
|
|
40283
|
+
nodesToDelete.push({ pos, node: node2 });
|
|
40284
|
+
}
|
|
40285
|
+
});
|
|
40286
|
+
if (!nodesToDelete.length) return;
|
|
40287
|
+
const tr = editor.state.tr;
|
|
40288
|
+
nodesToDelete.sort((a, b) => b.pos - a.pos).forEach(({ pos, node: node2 }) => {
|
|
40289
|
+
tr.delete(pos, pos + node2.nodeSize);
|
|
40290
|
+
});
|
|
40291
|
+
editor.view.dispatch(tr);
|
|
40292
|
+
};
|
|
40239
40293
|
const AnnotatorHelpers = {
|
|
40240
40294
|
getFieldAttrs,
|
|
40241
40295
|
processTables,
|
|
@@ -40243,7 +40297,8 @@ const AnnotatorHelpers = {
|
|
|
40243
40297
|
annotateHeadersAndFooters,
|
|
40244
40298
|
getAllHeaderFooterEditors,
|
|
40245
40299
|
updateHeaderFooterFieldAnnotations,
|
|
40246
|
-
deleteHeaderFooterFieldAnnotations
|
|
40300
|
+
deleteHeaderFooterFieldAnnotations,
|
|
40301
|
+
cleanUpListsWithAnnotations
|
|
40247
40302
|
};
|
|
40248
40303
|
const CollaborationPluginKey = new PluginKey("collaboration");
|
|
40249
40304
|
const Collaboration = Extension.create({
|
|
@@ -41053,7 +41108,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41053
41108
|
* @returns {Object | void} Migration results
|
|
41054
41109
|
*/
|
|
41055
41110
|
processCollaborationMigrations() {
|
|
41056
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.
|
|
41111
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.3");
|
|
41057
41112
|
if (!this.options.ydoc) return;
|
|
41058
41113
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41059
41114
|
let docVersion = metaMap.get("version");
|
|
@@ -22038,12 +22038,7 @@ const getParagraphIndent = (node2, docx, styleId = "") => {
|
|
|
22038
22038
|
return indent;
|
|
22039
22039
|
};
|
|
22040
22040
|
const getParagraphSpacing = (node2, docx, styleId = "", marks = []) => {
|
|
22041
|
-
const spacing = {
|
|
22042
|
-
lineSpaceAfter: 0,
|
|
22043
|
-
lineSpaceBefore: 0,
|
|
22044
|
-
line: 0,
|
|
22045
|
-
lineRule: null
|
|
22046
|
-
};
|
|
22041
|
+
const spacing = {};
|
|
22047
22042
|
const { spacing: pDefaultSpacing = {} } = getDefaultParagraphStyle(docx, styleId);
|
|
22048
22043
|
let lineSpaceAfter, lineSpaceBefore, line, lineRuleStyle;
|
|
22049
22044
|
const pPr = node2.elements?.find((el) => el.name === "w:pPr");
|
|
@@ -23292,7 +23287,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23292
23287
|
return;
|
|
23293
23288
|
}
|
|
23294
23289
|
}
|
|
23295
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.36-next.
|
|
23290
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.36-next.3") {
|
|
23296
23291
|
const customLocation = "docProps/custom.xml";
|
|
23297
23292
|
if (!docx[customLocation]) {
|
|
23298
23293
|
docx[customLocation] = generateCustomXml();
|
|
@@ -23759,7 +23754,7 @@ function storeSuperdocVersion(docx) {
|
|
|
23759
23754
|
function generateCustomXml() {
|
|
23760
23755
|
return DEFAULT_CUSTOM_XML;
|
|
23761
23756
|
}
|
|
23762
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.12.36-next.
|
|
23757
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.12.36-next.3") {
|
|
23763
23758
|
return {
|
|
23764
23759
|
type: "element",
|
|
23765
23760
|
name: "property",
|
|
@@ -40219,6 +40214,65 @@ const deleteHeaderFooterFieldAnnotations = ({ editor, fieldIdOrArray }) => {
|
|
|
40219
40214
|
);
|
|
40220
40215
|
});
|
|
40221
40216
|
};
|
|
40217
|
+
const cleanUpListsWithAnnotations = (fieldsToDelete = [], editor) => {
|
|
40218
|
+
if (!Array.isArray(fieldsToDelete)) fieldsToDelete = [fieldsToDelete];
|
|
40219
|
+
const { doc: doc2 } = editor.state;
|
|
40220
|
+
const docxAnnotations = getAllFieldAnnotations(editor.state) || [];
|
|
40221
|
+
const nodesToDelete = [];
|
|
40222
|
+
fieldsToDelete.forEach((fieldId) => {
|
|
40223
|
+
const matched = docxAnnotations.find((a) => a.node.attrs.fieldId === fieldId);
|
|
40224
|
+
if (!matched) return;
|
|
40225
|
+
const listItem = findParentNodeClosestToPos(
|
|
40226
|
+
doc2.resolve(matched.pos),
|
|
40227
|
+
(node22) => node22.type.name === "listItem"
|
|
40228
|
+
);
|
|
40229
|
+
if (!listItem) return;
|
|
40230
|
+
if (listItem.node.childCount !== 1) {
|
|
40231
|
+
let remainingNodes = listItem.node.childCount;
|
|
40232
|
+
let matchingNodesFound = 0;
|
|
40233
|
+
let hasOtherNodes = false;
|
|
40234
|
+
listItem.node.children.forEach((child, index2) => {
|
|
40235
|
+
const { type: type2 } = child;
|
|
40236
|
+
if (type2.name !== "paragraph") return;
|
|
40237
|
+
child.children.forEach((inline) => {
|
|
40238
|
+
const isFieldToDelete = fieldsToDelete.includes(inline.attrs.fieldId);
|
|
40239
|
+
const isMatchingField = inline.type.name === "fieldAnnotation" && isFieldToDelete;
|
|
40240
|
+
const isEmpty2 = inline.childCount === 0;
|
|
40241
|
+
if (!isEmpty2 && !isMatchingField) hasOtherNodes = true;
|
|
40242
|
+
if (isMatchingField) matchingNodesFound += 1;
|
|
40243
|
+
});
|
|
40244
|
+
});
|
|
40245
|
+
if (!hasOtherNodes && matchingNodesFound > 0) {
|
|
40246
|
+
remainingNodes -= matchingNodesFound;
|
|
40247
|
+
}
|
|
40248
|
+
if (remainingNodes > 0) {
|
|
40249
|
+
return;
|
|
40250
|
+
}
|
|
40251
|
+
}
|
|
40252
|
+
let { pos, node: node2, depth } = listItem;
|
|
40253
|
+
let $pos = doc2.resolve(pos);
|
|
40254
|
+
while (depth > 0) {
|
|
40255
|
+
const parent = $pos.node(depth - 1);
|
|
40256
|
+
if (parent.childCount === 1) {
|
|
40257
|
+
depth -= 1;
|
|
40258
|
+
pos = $pos.before(depth);
|
|
40259
|
+
node2 = parent;
|
|
40260
|
+
$pos = doc2.resolve(pos);
|
|
40261
|
+
} else {
|
|
40262
|
+
break;
|
|
40263
|
+
}
|
|
40264
|
+
}
|
|
40265
|
+
if (!nodesToDelete.some((n) => n.pos === pos)) {
|
|
40266
|
+
nodesToDelete.push({ pos, node: node2 });
|
|
40267
|
+
}
|
|
40268
|
+
});
|
|
40269
|
+
if (!nodesToDelete.length) return;
|
|
40270
|
+
const tr = editor.state.tr;
|
|
40271
|
+
nodesToDelete.sort((a, b) => b.pos - a.pos).forEach(({ pos, node: node2 }) => {
|
|
40272
|
+
tr.delete(pos, pos + node2.nodeSize);
|
|
40273
|
+
});
|
|
40274
|
+
editor.view.dispatch(tr);
|
|
40275
|
+
};
|
|
40222
40276
|
const AnnotatorHelpers = {
|
|
40223
40277
|
getFieldAttrs,
|
|
40224
40278
|
processTables,
|
|
@@ -40226,7 +40280,8 @@ const AnnotatorHelpers = {
|
|
|
40226
40280
|
annotateHeadersAndFooters,
|
|
40227
40281
|
getAllHeaderFooterEditors,
|
|
40228
40282
|
updateHeaderFooterFieldAnnotations,
|
|
40229
|
-
deleteHeaderFooterFieldAnnotations
|
|
40283
|
+
deleteHeaderFooterFieldAnnotations,
|
|
40284
|
+
cleanUpListsWithAnnotations
|
|
40230
40285
|
};
|
|
40231
40286
|
const CollaborationPluginKey = new PluginKey("collaboration");
|
|
40232
40287
|
const Collaboration = Extension.create({
|
|
@@ -41036,7 +41091,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41036
41091
|
* @returns {Object | void} Migration results
|
|
41037
41092
|
*/
|
|
41038
41093
|
processCollaborationMigrations() {
|
|
41039
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.
|
|
41094
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.3");
|
|
41040
41095
|
if (!this.options.ydoc) return;
|
|
41041
41096
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41042
41097
|
let docVersion = metaMap.get("version");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as commonjsGlobal, g as getDefaultExportFromCjs, a as getAugmentedNamespace } from "./jszip-BmWWPxfF.es.js";
|
|
2
|
-
import { t as type, g as getIntrinsic, c as callBound$2 } from "./xml-js-
|
|
2
|
+
import { t as type, g as getIntrinsic, c as callBound$2 } from "./xml-js-BV-kCPOA.es.js";
|
|
3
3
|
import { _ as __viteBrowserExternal } from "./__vite-browser-external-CURh0WXD.es.js";
|
|
4
4
|
var punycode$1 = { exports: {} };
|
|
5
5
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jszip = require("./jszip-Bwu_om3F.cjs");
|
|
3
|
-
const xmlJs = require("./xml-js-
|
|
3
|
+
const xmlJs = require("./xml-js-B7Vccv2s.cjs");
|
|
4
4
|
const __viteBrowserExternal = require("./__vite-browser-external-DWbQq7bv.cjs");
|
|
5
5
|
var punycode$1 = { exports: {} };
|
|
6
6
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
@@ -457,7 +457,7 @@ var type = TypeError;
|
|
|
457
457
|
var uri = URIError;
|
|
458
458
|
var abs$1 = Math.abs;
|
|
459
459
|
var floor$1 = Math.floor;
|
|
460
|
-
var max$
|
|
460
|
+
var max$1 = Math.max;
|
|
461
461
|
var min$1 = Math.min;
|
|
462
462
|
var pow$1 = Math.pow;
|
|
463
463
|
var round$1 = Math.round;
|
|
@@ -515,86 +515,93 @@ function requireHasSymbols() {
|
|
|
515
515
|
return hasSymbols$1;
|
|
516
516
|
}
|
|
517
517
|
var Reflect_getPrototypeOf = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
|
|
518
|
-
var
|
|
519
|
-
var
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
var
|
|
530
|
-
var
|
|
531
|
-
var
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
arr
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
var
|
|
542
|
-
|
|
543
|
-
for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
544
|
-
arr[j] = arrLike[i];
|
|
545
|
-
}
|
|
546
|
-
return arr;
|
|
547
|
-
};
|
|
548
|
-
var joiny = function(arr, joiner) {
|
|
549
|
-
var str = "";
|
|
550
|
-
for (var i = 0; i < arr.length; i += 1) {
|
|
551
|
-
str += arr[i];
|
|
552
|
-
if (i + 1 < arr.length) {
|
|
553
|
-
str += joiner;
|
|
518
|
+
var $Object$2 = esObjectAtoms;
|
|
519
|
+
var Object_getPrototypeOf = $Object$2.getPrototypeOf || null;
|
|
520
|
+
var implementation;
|
|
521
|
+
var hasRequiredImplementation;
|
|
522
|
+
function requireImplementation() {
|
|
523
|
+
if (hasRequiredImplementation) return implementation;
|
|
524
|
+
hasRequiredImplementation = 1;
|
|
525
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
526
|
+
var toStr2 = Object.prototype.toString;
|
|
527
|
+
var max2 = Math.max;
|
|
528
|
+
var funcType = "[object Function]";
|
|
529
|
+
var concatty = function concatty2(a, b) {
|
|
530
|
+
var arr = [];
|
|
531
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
532
|
+
arr[i] = a[i];
|
|
533
|
+
}
|
|
534
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
535
|
+
arr[j + a.length] = b[j];
|
|
536
|
+
}
|
|
537
|
+
return arr;
|
|
538
|
+
};
|
|
539
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
540
|
+
var arr = [];
|
|
541
|
+
for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
542
|
+
arr[j] = arrLike[i];
|
|
554
543
|
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
var
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
var args = slicy(arguments, 1);
|
|
564
|
-
var bound;
|
|
565
|
-
var binder = function() {
|
|
566
|
-
if (this instanceof bound) {
|
|
567
|
-
var result = target.apply(
|
|
568
|
-
this,
|
|
569
|
-
concatty(args, arguments)
|
|
570
|
-
);
|
|
571
|
-
if (Object(result) === result) {
|
|
572
|
-
return result;
|
|
544
|
+
return arr;
|
|
545
|
+
};
|
|
546
|
+
var joiny = function(arr, joiner) {
|
|
547
|
+
var str = "";
|
|
548
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
549
|
+
str += arr[i];
|
|
550
|
+
if (i + 1 < arr.length) {
|
|
551
|
+
str += joiner;
|
|
573
552
|
}
|
|
574
|
-
return this;
|
|
575
553
|
}
|
|
576
|
-
return
|
|
577
|
-
that,
|
|
578
|
-
concatty(args, arguments)
|
|
579
|
-
);
|
|
554
|
+
return str;
|
|
580
555
|
};
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
var
|
|
556
|
+
implementation = function bind2(that) {
|
|
557
|
+
var target = this;
|
|
558
|
+
if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
|
|
559
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
560
|
+
}
|
|
561
|
+
var args = slicy(arguments, 1);
|
|
562
|
+
var bound;
|
|
563
|
+
var binder = function() {
|
|
564
|
+
if (this instanceof bound) {
|
|
565
|
+
var result = target.apply(
|
|
566
|
+
this,
|
|
567
|
+
concatty(args, arguments)
|
|
568
|
+
);
|
|
569
|
+
if (Object(result) === result) {
|
|
570
|
+
return result;
|
|
571
|
+
}
|
|
572
|
+
return this;
|
|
573
|
+
}
|
|
574
|
+
return target.apply(
|
|
575
|
+
that,
|
|
576
|
+
concatty(args, arguments)
|
|
577
|
+
);
|
|
589
578
|
};
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
var
|
|
579
|
+
var boundLength = max2(0, target.length - args.length);
|
|
580
|
+
var boundArgs = [];
|
|
581
|
+
for (var i = 0; i < boundLength; i++) {
|
|
582
|
+
boundArgs[i] = "$" + i;
|
|
583
|
+
}
|
|
584
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
585
|
+
if (target.prototype) {
|
|
586
|
+
var Empty = function Empty2() {
|
|
587
|
+
};
|
|
588
|
+
Empty.prototype = target.prototype;
|
|
589
|
+
bound.prototype = new Empty();
|
|
590
|
+
Empty.prototype = null;
|
|
591
|
+
}
|
|
592
|
+
return bound;
|
|
593
|
+
};
|
|
594
|
+
return implementation;
|
|
595
|
+
}
|
|
596
|
+
var functionBind;
|
|
597
|
+
var hasRequiredFunctionBind;
|
|
598
|
+
function requireFunctionBind() {
|
|
599
|
+
if (hasRequiredFunctionBind) return functionBind;
|
|
600
|
+
hasRequiredFunctionBind = 1;
|
|
601
|
+
var implementation2 = requireImplementation();
|
|
602
|
+
functionBind = Function.prototype.bind || implementation2;
|
|
603
|
+
return functionBind;
|
|
604
|
+
}
|
|
598
605
|
var functionCall;
|
|
599
606
|
var hasRequiredFunctionCall;
|
|
600
607
|
function requireFunctionCall() {
|
|
@@ -612,12 +619,12 @@ function requireFunctionApply() {
|
|
|
612
619
|
return functionApply;
|
|
613
620
|
}
|
|
614
621
|
var reflectApply$1 = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
|
|
615
|
-
var bind$3 =
|
|
622
|
+
var bind$3 = requireFunctionBind();
|
|
616
623
|
var $apply$2 = requireFunctionApply();
|
|
617
624
|
var $call$2 = requireFunctionCall();
|
|
618
625
|
var $reflectApply = reflectApply$1;
|
|
619
626
|
var actualApply$1 = $reflectApply || bind$3.call($call$2, $apply$2);
|
|
620
|
-
var bind$2 =
|
|
627
|
+
var bind$2 = requireFunctionBind();
|
|
621
628
|
var $TypeError$4 = type;
|
|
622
629
|
var $call$1 = requireFunctionCall();
|
|
623
630
|
var $actualApply = actualApply$1;
|
|
@@ -652,7 +659,7 @@ var get = desc && typeof desc.get === "function" ? callBind$2([desc.get]) : type
|
|
|
652
659
|
}
|
|
653
660
|
) : false;
|
|
654
661
|
var reflectGetProto = Reflect_getPrototypeOf;
|
|
655
|
-
var originalGetProto =
|
|
662
|
+
var originalGetProto = Object_getPrototypeOf;
|
|
656
663
|
var getDunderProto = get;
|
|
657
664
|
var getProto$3 = reflectGetProto ? function getProto(O) {
|
|
658
665
|
return reflectGetProto(O);
|
|
@@ -671,8 +678,8 @@ function requireHasown() {
|
|
|
671
678
|
hasRequiredHasown = 1;
|
|
672
679
|
var call = Function.prototype.call;
|
|
673
680
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
674
|
-
var
|
|
675
|
-
hasown =
|
|
681
|
+
var bind2 = requireFunctionBind();
|
|
682
|
+
hasown = bind2.call(call, $hasOwn);
|
|
676
683
|
return hasown;
|
|
677
684
|
}
|
|
678
685
|
var undefined$1;
|
|
@@ -686,7 +693,7 @@ var $TypeError$3 = type;
|
|
|
686
693
|
var $URIError = uri;
|
|
687
694
|
var abs = abs$1;
|
|
688
695
|
var floor = floor$1;
|
|
689
|
-
var max = max$
|
|
696
|
+
var max = max$1;
|
|
690
697
|
var min = min$1;
|
|
691
698
|
var pow = pow$1;
|
|
692
699
|
var round = round$1;
|
|
@@ -717,7 +724,7 @@ var ThrowTypeError = $gOPD ? function() {
|
|
|
717
724
|
}() : throwTypeError;
|
|
718
725
|
var hasSymbols2 = requireHasSymbols()();
|
|
719
726
|
var getProto$2 = getProto$3;
|
|
720
|
-
var $ObjectGPO =
|
|
727
|
+
var $ObjectGPO = Object_getPrototypeOf;
|
|
721
728
|
var $ReflectGPO = Reflect_getPrototypeOf;
|
|
722
729
|
var $apply$1 = requireFunctionApply();
|
|
723
730
|
var $call = requireFunctionCall();
|
|
@@ -891,7 +898,7 @@ var LEGACY_ALIASES = {
|
|
|
891
898
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
892
899
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
893
900
|
};
|
|
894
|
-
var bind$1 =
|
|
901
|
+
var bind$1 = requireFunctionBind();
|
|
895
902
|
var hasOwn$1 = requireHasown();
|
|
896
903
|
var $concat = bind$1.call($call, Array.prototype.concat);
|
|
897
904
|
var $spliceApply = bind$1.call($apply$1, Array.prototype.splice);
|
|
@@ -1433,11 +1440,11 @@ var setFunctionLength = function setFunctionLength2(fn2, length) {
|
|
|
1433
1440
|
}
|
|
1434
1441
|
return fn2;
|
|
1435
1442
|
};
|
|
1436
|
-
var
|
|
1443
|
+
var bind = requireFunctionBind();
|
|
1437
1444
|
var $apply = requireFunctionApply();
|
|
1438
1445
|
var actualApply = actualApply$1;
|
|
1439
1446
|
var applyBind = function applyBind2() {
|
|
1440
|
-
return actualApply(
|
|
1447
|
+
return actualApply(bind, $apply, arguments);
|
|
1441
1448
|
};
|
|
1442
1449
|
(function(module2) {
|
|
1443
1450
|
var setFunctionLength$1 = setFunctionLength;
|