From 72e67821603de895056623910fa3b6f5c5617a0a Mon Sep 17 00:00:00 2001 From: tinohager Date: Mon, 11 Mar 2024 12:03:27 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20tinohage?= =?UTF-8?q?r/word-addin@f59195b1c5355a934ebc1406091319fc1b112018=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taskpane.html | 2 +- taskpane.js | 2 +- taskpane.js.map | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/taskpane.html b/taskpane.html index 3e8a77c..fc566a7 100644 --- a/taskpane.html +++ b/taskpane.html @@ -1 +1 @@ -Contoso Task Pane Add-in
Contoso

AddInn

Please sideload your add-in to see app body.

Run V1 Run V2

\ No newline at end of file +Contoso Task Pane Add-in
Contoso

AddInn

Please sideload your add-in to see app body.

Demo Run V1 Run V2

\ No newline at end of file diff --git a/taskpane.js b/taskpane.js index ae006a1..d08c2cc 100644 --- a/taskpane.js +++ b/taskpane.js @@ -1,2 +1,2 @@ -!function(){"use strict";var e,t,o,n,r={14385:function(e){e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),t.hash&&(e+=t.hash),t.maybeNeedQuotes&&/[\t\n\f\r "'=<>`]/.test(e)?'"'.concat(e,'"'):e):e}},98362:function(e,t,o){e.exports=o.p+"assets/logo-filled.png"},58394:function(e,t,o){e.exports=o.p+"1fda685b81e1123773f6.css"}},s={};function c(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,c),o.exports}c.m=r,c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;c.g.importScripts&&(e=c.g.location+"");var t=c.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e}(),c.b=document.baseURI||self.location.href,function(){async function e(){return console.log("Run V1.1"),await Word.run((async e=>{let t=performance.now();document.getElementById("progressbox").style.display="block",document.getElementById("progressbar").style.width="0%";const o=e.document.body.paragraphs;o.load(["text"]),await e.sync(),document.getElementById("progressbar").style.width="10%";let n=performance.now();console.log(`Execution time load paragraphs: ${n-t} ms`),t=performance.now();const r=[];for(let e=0;e2&&(t.items[1].font.bold=!0,t.items[2].font.bold=!0)}catch(e){console.error("error on process - "+e)}}document.getElementById("progressbar").style.width="60%",n=performance.now(),console.log(`Execution time update word formatting: ${n-t} ms`),t=performance.now(),await e.sync(),n=performance.now(),console.log(`Execution time context sync: ${n-t} ms`),document.getElementById("progressbar").style.width="100%",document.getElementById("progressbox").style.display="none"}))}async function t(){return console.log("Run V2.1"),await Word.run((async e=>{const t=performance.now();document.getElementById("progressbox").style.display="block",document.getElementById("progressbar").style.width="0%";const o=e.document.body.paragraphs;o.load("text"),await e.sync(),document.getElementById("progressbar").style.width="10%";for(let t=0;t2&&(t.items[1].font.bold=!0,t.items[2].font.bold=!0)}}}await e.sync();const n=performance.now();console.log(`Execution time: ${n-t} ms`),document.getElementById("progressbar").style.width="100%",document.getElementById("progressbox").style.display="none"}))}Office.onReady((o=>{o.host===Office.HostType.Word&&(document.getElementById("sideload-msg").style.display="none",document.getElementById("app-body").style.display="flex",document.getElementById("run1").onclick=e,document.getElementById("run2").onclick=t)}))}(),e=c(14385),t=c.n(e),o=new URL(c(58394),c.b),n=new URL(c(98362),c.b),t()(o),t()(n)}(); +!function(){"use strict";var e,t,o,n,s={14385:function(e){e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),t.hash&&(e+=t.hash),t.maybeNeedQuotes&&/[\t\n\f\r "'=<>`]/.test(e)?'"'.concat(e,'"'):e):e}},98362:function(e,t,o){e.exports=o.p+"assets/logo-filled.png"},58394:function(e,t,o){e.exports=o.p+"1fda685b81e1123773f6.css"}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return s[e](o,o.exports,c),o.exports}c.m=s,c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;c.g.importScripts&&(e=c.g.location+"");var t=c.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e}(),c.b=document.baseURI||self.location.href,function(){const e="1.3";async function t(){await Word.run((async e=>{let t=performance.now();var o=e.document.body.paragraphs;e.load(o,["items"]),await e.sync(),console.log(o.items.length);const n=[];for(let e=0;e{let t=performance.now();document.getElementById("progressbox").style.display="block",document.getElementById("progressbar").style.width="0%";const o=e.document.body.paragraphs;o.load("$all"),await o.context.sync(),document.getElementById("progressbar").style.width="10%";let n=performance.now();console.log(`Execution time load paragraphs: ${n-t} ms`),t=performance.now();const s=[];for(let e=0;e2&&(t.items[1].font.bold=!0,t.items[2].font.bold=!0)}catch(e){console.error("error on process - "+e)}}document.getElementById("progressbar").style.width="60%",n=performance.now(),console.log(`Execution time update word formatting: ${n-t} ms`),t=performance.now(),await e.sync(),n=performance.now(),console.log(`Execution time context sync: ${n-t} ms`),document.getElementById("progressbar").style.width="100%",document.getElementById("progressbox").style.display="none"}))}async function n(){return console.log(`Run V2 - (V${e})`),await Word.run((async e=>{const t=performance.now();document.getElementById("progressbox").style.display="block",document.getElementById("progressbar").style.width="0%";const o=e.document.body.paragraphs;o.load("$all"),await o.context.sync(),document.getElementById("progressbar").style.width="10%";for(let t=0;t2&&(t.items[1].font.bold=!0,t.items[2].font.bold=!0)}}}await e.sync();const n=performance.now();console.log(`Execution time: ${n-t} ms`),document.getElementById("progressbar").style.width="100%",document.getElementById("progressbox").style.display="none"}))}Office.onReady((s=>{s.host===Office.HostType.Word&&(console.log(`AddIn - V${e}`),document.getElementById("sideload-msg").style.display="none",document.getElementById("app-body").style.display="flex",document.getElementById("runDemo").onclick=t,document.getElementById("run1").onclick=o,document.getElementById("run2").onclick=n)}))}(),e=c(14385),t=c.n(e),o=new URL(c(58394),c.b),n=new URL(c(98362),c.b),t()(o),t()(n)}(); //# sourceMappingURL=taskpane.js.map \ No newline at end of file diff --git a/taskpane.js.map b/taskpane.js.map index 18a752f..c8c7e87 100644 --- a/taskpane.js.map +++ b/taskpane.js.map @@ -1 +1 @@ -{"version":3,"file":"taskpane.js","mappings":"iCAEIA,EACAC,E,qBCDJC,EAAOC,QAAU,SAAUC,EAAKC,GAM9B,OALKA,IAEHA,EAAU,CAAC,GAGRD,GAKLA,EAAME,OAAOF,EAAIG,WAAaH,EAAII,QAAUJ,GAExCC,EAAQI,OAEVL,GAAOC,EAAQI,MAGbJ,EAAQK,iBAAmB,oBAAoBC,KAAKP,GAC/C,IAAKQ,OAAOR,EAAK,KAGnBA,GAfEA,CAgBX,C,iICxBIS,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C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AC1Cf,SAASuB,eAAe,QAAQgC,QAAUP,EAC5C,G,wBTXE7F,EAA6B,IAAIqG,IAAI,cACrCpG,EAA6B,IAAIoG,IAAI,cAEH,IAAyCrG,GACzC,IAAyCC,E","sources":["webpack://office-addin-taskpane/./src/taskpane/taskpane.html","webpack://office-addin-taskpane/./node_modules/html-loader/dist/runtime/getUrl.js","webpack://office-addin-taskpane/webpack/bootstrap","webpack://office-addin-taskpane/webpack/runtime/compat get default export","webpack://office-addin-taskpane/webpack/runtime/define property getters","webpack://office-addin-taskpane/webpack/runtime/global","webpack://office-addin-taskpane/webpack/runtime/hasOwnProperty shorthand","webpack://office-addin-taskpane/webpack/runtime/publicPath","webpack://office-addin-taskpane/webpack/runtime/jsonp chunk loading","webpack://office-addin-taskpane/./src/taskpane/taskpane.ts"],"sourcesContent":["// Imports\nimport ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \"../../node_modules/html-loader/dist/runtime/getUrl.js\";\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"./taskpane.css\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_1___ = new URL(\"../../assets/logo-filled.png\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);\nvar code = \" Contoso Task Pane Add-in <\" + \"script src=\\\"https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js\\\"><\" + \"/script>
\\\"Contoso\\\"

AddInn

Please sideload your add-in to see app body.

Run V1 Run V2

\";\n// Exports\nexport default code;","\"use strict\";\n\nmodule.exports = function (url, options) {\n if (!options) {\n // eslint-disable-next-line no-param-reassign\n options = {};\n }\n\n if (!url) {\n return url;\n } // eslint-disable-next-line no-underscore-dangle, no-param-reassign\n\n\n url = String(url.__esModule ? url.default : url);\n\n if (options.hash) {\n // eslint-disable-next-line no-param-reassign\n url += options.hash;\n }\n\n if (options.maybeNeedQuotes && /[\\t\\n\\f\\r \"'=<>`]/.test(url)) {\n return \"\\\"\".concat(url, \"\\\"\");\n }\n\n return url;\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t926: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// no jsonp function","/*\n * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n * See LICENSE in the project root for license information.\n */\n\n/* global document, Office, Word */\n\nOffice.onReady((info) => {\n if (info.host === Office.HostType.Word) {\n document.getElementById(\"sideload-msg\").style.display = \"none\";\n document.getElementById(\"app-body\").style.display = \"flex\";\n document.getElementById(\"run1\").onclick = run1;\n document.getElementById(\"run2\").onclick = run2;\n }\n});\n\nexport async function run1() {\n console.log(\"Run V1.1\");\n return await Word.run(async (context) => {\n let start = performance.now();\n\n document.getElementById(\"progressbox\").style.display = \"block\";\n document.getElementById(\"progressbar\").style.width = \"0%\";\n\n const paragraphs = context.document.body.paragraphs;\n\n // load text\n //paragraphs.load(\"$all\");\n paragraphs.load([\"text\"]);\n await context.sync();\n\n document.getElementById(\"progressbar\").style.width = \"10%\";\n\n let end = performance.now();\n console.log(`Execution time load paragraphs: ${end - start} ms`);\n start = performance.now();\n\n const wordsRangeCollections = [];\n\n for (let i = 0; i < paragraphs.items.length; i++) {\n const paragraph = paragraphs.items[i];\n\n // only process if text available\n if (paragraph.text) {\n const wordsRangeCollection = paragraph.getRange().split([\" \"]);\n\n wordsRangeCollection.load(\"$none\");\n wordsRangeCollections.push(wordsRangeCollection);\n }\n }\n\n try {\n await context.sync();\n } catch (error) {\n console.error(\"error on sync2 - \" + error);\n }\n\n end = performance.now();\n console.log(`Execution time load wordsRangeCollections: ${end - start} ms`);\n start = performance.now();\n\n const wordChars = [];\n\n for (let i = 0; i < wordsRangeCollections.length; i++) {\n const wordsRangeCollection = wordsRangeCollections[i];\n\n for (let j = 0; j < wordsRangeCollection.items.length; j++) {\n const wordRange = wordsRangeCollection.items[j];\n\n const wordChar = wordRange.getRange().split([\"\"]);\n\n wordChar.load(\"$none\");\n wordChars.push(wordChar);\n //wordChar.untrack();\n }\n }\n\n document.getElementById(\"progressbar\").style.width = \"30%\";\n\n end = performance.now();\n console.log(`Execution time load wordChars: ${end - start} ms`);\n start = performance.now();\n\n document.getElementById(\"progressbar\").style.width = \"40%\";\n\n try {\n await context.sync();\n } catch (error) {\n console.error(\"error on sync2 - \" + error);\n }\n\n document.getElementById(\"progressbar\").style.width = \"50%\";\n\n for (let j = 0; j < wordChars.length; j++) {\n const wordChar = wordChars[j];\n try {\n if (wordChar && !wordChar.isNullObject) {\n if (wordChar.items.length > 2) {\n wordChar.items[1].font.bold = true;\n wordChar.items[2].font.bold = true;\n }\n }\n } catch (error) {\n console.error(\"error on process - \" + error);\n }\n }\n\n // Synchronize the document state.\n\n document.getElementById(\"progressbar\").style.width = \"60%\";\n\n end = performance.now();\n console.log(`Execution time update word formatting: ${end - start} ms`);\n start = performance.now();\n\n await context.sync();\n\n end = performance.now();\n console.log(`Execution time context sync: ${end - start} ms`);\n\n document.getElementById(\"progressbar\").style.width = \"100%\";\n document.getElementById(\"progressbox\").style.display = \"none\";\n });\n}\n\nexport async function run2() {\n console.log(\"Run V2.1\");\n return await Word.run(async (context) => {\n const start = performance.now();\n\n document.getElementById(\"progressbox\").style.display = \"block\";\n document.getElementById(\"progressbar\").style.width = \"0%\";\n\n const paragraphs = context.document.body.paragraphs;\n\n // load text\n //paragraphs.load(\"$all\");\n paragraphs.load(\"text\");\n await context.sync();\n\n document.getElementById(\"progressbar\").style.width = \"10%\";\n\n for (let i = 0; i < paragraphs.items.length; i++) {\n const paragraph = paragraphs.items[i];\n\n const percentage = (100 * i) / paragraphs.items.length;\n document.getElementById(\"progressbar\").style.width = percentage + \"%\";\n\n // only process if text available\n if (paragraph.text) {\n const wordsRangeCollection = paragraph.getRange().split([\" \"]);\n wordsRangeCollection.load(\"$none\");\n\n await wordsRangeCollection.context.sync();\n\n const wordChars = [];\n\n for (let j = 0; j < wordsRangeCollection.items.length; j++) {\n const wordRange = wordsRangeCollection.items[j];\n\n const wordChar = wordRange.getRange().split([\"\"]);\n\n //wordChar.load(\"font\");\n wordChar.load(\"$none\");\n\n wordChars.push(wordChar);\n }\n\n try {\n await context.sync();\n } catch (error) {\n console.error(\"error on sync - \" + error);\n continue;\n }\n\n for (let j = 0; j < wordChars.length; j++) {\n const wordChar = wordChars[j];\n\n if (wordChar && !wordChar.isNullObject) {\n if (wordChar.items.length > 2) {\n wordChar.items[1].font.bold = true;\n wordChar.items[2].font.bold = true;\n }\n }\n }\n }\n }\n\n // Synchronize the document state.\n await context.sync();\n\n const end = performance.now();\n console.log(`Execution time: ${end - start} ms`);\n\n document.getElementById(\"progressbar\").style.width = \"100%\";\n document.getElementById(\"progressbox\").style.display = \"none\";\n });\n}\n"],"names":["___HTML_LOADER_IMPORT_0___","___HTML_LOADER_IMPORT_1___","module","exports","url","options","String","__esModule","default","hash","maybeNeedQuotes","test","concat","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","n","getter","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","length","i","Error","replace","p","b","baseURI","self","href","async","run1","console","log","Word","run","start","performance","now","getElementById","style","display","width","paragraphs","context","body","load","sync","end","wordsRangeCollections","items","paragraph","text","wordsRangeCollection","getRange","split","push","error","wordChars","j","wordChar","isNullObject","font","bold","run2","percentage","Office","onReady","info","host","HostType","onclick","URL"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"taskpane.js","mappings":"iCAEIA,EACAC,E,qBCDJC,EAAOC,QAAU,SAAUC,EAAKC,GAM9B,OALKA,IAEHA,EAAU,CAAC,GAGRD,GAKLA,EAAME,OAAOF,EAAIG,WAAaH,EAAII,QAAUJ,GAExCC,EAAQI,OAEVL,GAAOC,EAAQI,MAGbJ,EAAQK,iBAAmB,oBAAoBC,KAAKP,GAC/C,IAAKQ,OAAOR,EAAK,KAGnBA,GAfEA,CAgBX,C,iICxBIS,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAab,QAGrB,IAAID,EAASW,EAAyBE,GAAY,CAGjDZ,QAAS,CAAC,GAOX,OAHAe,EAAoBH,GAAUb,EAAQA,EAAOC,QAASW,GAG/CZ,EAAOC,OACf,CAGAW,EAAoBK,EAAID,ECxBxBJ,EAAoBM,EAAI,SAASlB,GAChC,IAAImB,EAASnB,GAAUA,EAAOK,WAC7B,WAAa,OAAOL,EAAgB,OAAG,EACvC,WAAa,OAAOA,CAAQ,EAE7B,OADAY,EAAoBQ,EAAED,EAAQ,CAAEE,EAAGF,IAC5BA,CACR,ECNAP,EAAoBQ,EAAI,SAASnB,EAASqB,GACzC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEvB,EAASsB,IAC5EE,OAAOC,eAAezB,EAASsB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAX,EAAoBiB,EAAI,WACv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lC,EAAQG,MAChB,CAAE,MAAO4B,GACP3B,QAAQ2B,MAAM,mBAAqBA,GACnC,QACF,CAEA,IAAK,IAAIE,EAAI,EAAGA,EAAID,EAAUlD,OAAQmD,IAAK,CACzC,MAAMC,EAAWF,EAAUC,GAEvBC,GACEA,EAAS5B,MAAMxB,OAAS,IAC1BoD,EAAS5B,MAAM,GAAGY,KAAKC,MAAO,EAC9Be,EAAS5B,MAAM,GAAGY,KAAKC,MAAO,EAGpC,CACF,CACF,OAGMnB,EAAQG,OAEd,MAAMiB,EAAMvB,YAAYC,MACxBM,QAAQC,IAAK,mBAAkBe,EAAMxB,QAErCnB,SAAS6C,eAAe,eAAeC,MAAME,MAAQ,OACrDhD,SAAS6C,eAAe,eAAeC,MAAMC,QAAU,MAAM,GAEjE,CA/QAa,OAAOC,SAASC,IACVA,EAAKC,OAASH,OAAOI,SAAS/C,OAChCU,QAAQC,IAAK,YAAWd,KACxBd,SAAS6C,eAAe,gBAAgBC,MAAMC,QAAU,OACxD/C,SAAS6C,eAAe,YAAYC,MAAMC,QAAU,OACpD/C,SAAS6C,eAAe,WAAWoB,QAAUjD,EAC7ChB,SAAS6C,eAAe,QAAQoB,QAAUrB,EAC1C5C,SAAS6C,eAAe,QAAQoB,QAAUP,EAC5C,G,wBTjBEvG,EAA6B,IAAI+G,IAAI,cACrC9G,EAA6B,IAAI8G,IAAI,cAEH,IAAyC/G,GACzC,IAAyCC,E","sources":["webpack://office-addin-taskpane/./src/taskpane/taskpane.html","webpack://office-addin-taskpane/./node_modules/html-loader/dist/runtime/getUrl.js","webpack://office-addin-taskpane/webpack/bootstrap","webpack://office-addin-taskpane/webpack/runtime/compat get default export","webpack://office-addin-taskpane/webpack/runtime/define property getters","webpack://office-addin-taskpane/webpack/runtime/global","webpack://office-addin-taskpane/webpack/runtime/hasOwnProperty shorthand","webpack://office-addin-taskpane/webpack/runtime/publicPath","webpack://office-addin-taskpane/webpack/runtime/jsonp chunk loading","webpack://office-addin-taskpane/./src/taskpane/taskpane.ts"],"sourcesContent":["// Imports\nimport ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \"../../node_modules/html-loader/dist/runtime/getUrl.js\";\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"./taskpane.css\", import.meta.url);\nvar ___HTML_LOADER_IMPORT_1___ = new URL(\"../../assets/logo-filled.png\", import.meta.url);\n// Module\nvar ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);\nvar ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);\nvar code = \" Contoso Task Pane Add-in <\" + \"script src=\\\"https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js\\\"><\" + \"/script>
\\\"Contoso\\\"

AddInn

Please sideload your add-in to see app body.

Demo Run V1 Run V2

\";\n// Exports\nexport default code;","\"use strict\";\n\nmodule.exports = function (url, options) {\n if (!options) {\n // eslint-disable-next-line no-param-reassign\n options = {};\n }\n\n if (!url) {\n return url;\n } // eslint-disable-next-line no-underscore-dangle, no-param-reassign\n\n\n url = String(url.__esModule ? url.default : url);\n\n if (options.hash) {\n // eslint-disable-next-line no-param-reassign\n url += options.hash;\n }\n\n if (options.maybeNeedQuotes && /[\\t\\n\\f\\r \"'=<>`]/.test(url)) {\n return \"\\\"\".concat(url, \"\\\"\");\n }\n\n return url;\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t926: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// no jsonp function","/*\n * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n * See LICENSE in the project root for license information.\n */\n\nimport { container } from \"webpack\";\n\n/* global document, Office, Word */\n\nconst addinVersion = \"1.3\";\n\nOffice.onReady((info) => {\n if (info.host === Office.HostType.Word) {\n console.log(`AddIn - V${addinVersion}`);\n document.getElementById(\"sideload-msg\").style.display = \"none\";\n document.getElementById(\"app-body\").style.display = \"flex\";\n document.getElementById(\"runDemo\").onclick = insertTextIntoRange;\n document.getElementById(\"run1\").onclick = run1;\n document.getElementById(\"run2\").onclick = run2;\n }\n});\n\nexport async function insertTextIntoRange() {\n await Word.run(async (context) => {\n let start = performance.now();\n\n var paragraphs = context.document.body.paragraphs;\n\n context.load(paragraphs, [\"items\"]);\n await context.sync();\n\n console.log(paragraphs.items.length);\n\n const words1: Word.RangeCollection[] = [];\n\n for (let x = 0; x < paragraphs.items.length; ++x) {\n const paragraph = paragraphs.items[x];\n console.log(`load paragraph ${x}`);\n\n var words = paragraph.getTextRanges([\" \"], true);\n words1.push(words);\n }\n\n for (const words of words1) {\n context.load(words, [\"items\"]);\n }\n await context.sync();\n\n console.log(\"process words...\");\n const chars1: Word.RangeCollection[] = [];\n for (const words of words1) {\n for (var i = 0; i < words.items.length; ++i) {\n const charRanges = words.items[i].search(\"?\", { matchWildcards: true });\n chars1.push(charRanges);\n //charRanges.load();\n context.load(charRanges, [\"items\", \"font\"]);\n // await charRanges.context.sync();\n\n // for (let z = 0; z < charRanges.items.length; ++z) {\n // //console.log(charRanges.items[z].text);\n // if (z < 2) {\n // charRanges.items[z].font.bold = true;\n // }\n // }\n }\n }\n\n await context.sync();\n\n console.log(\"process chars...\");\n for (const charRanges of chars1) {\n // const charRanges = words.items[i].search(\"?\", { matchWildcards: true });\n // chars1.push(charRanges);\n // //charRanges.load();\n // context.load(charRanges, [\"items\"]);\n // await charRanges.context.sync();\n\n for (let z = 0; z < charRanges.items.length; ++z) {\n //console.log(charRanges.items[z].text);\n if (z < 2) {\n if (charRanges.items[z].font.bold !== true) {\n charRanges.items[z].font.bold = true;\n }\n } else {\n //charRanges.items[z].font.bold = false;\n }\n }\n }\n\n console.log(\"last sync step, update document\");\n await context.sync();\n console.log(\"done\");\n\n const end = performance.now();\n console.log(`Execution time context sync: ${end - start} ms`);\n });\n}\n\nexport async function run1() {\n console.log(`Run V1 - (V${addinVersion})`);\n return await Word.run(async (context) => {\n let start = performance.now();\n\n document.getElementById(\"progressbox\").style.display = \"block\";\n document.getElementById(\"progressbar\").style.width = \"0%\";\n\n const paragraphs = context.document.body.paragraphs;\n\n // load text\n paragraphs.load(\"$all\");\n //paragraphs.load([\"text\", \"items\"]);\n await paragraphs.context.sync();\n\n document.getElementById(\"progressbar\").style.width = \"10%\";\n\n let end = performance.now();\n console.log(`Execution time load paragraphs: ${end - start} ms`);\n start = performance.now();\n\n const wordsRangeCollections = [];\n\n for (let i = 0; i < paragraphs.items.length; i++) {\n const paragraph = paragraphs.items[i];\n\n paragraph.load(\"text\");\n\n // only process if text available\n if (paragraph.text) {\n const wordsRangeCollection = paragraph.getRange().split([\" \"]);\n\n wordsRangeCollection.load(\"$none\");\n wordsRangeCollections.push(wordsRangeCollection);\n }\n }\n\n try {\n await context.sync();\n } catch (error) {\n console.error(\"error on sync2 - \" + error);\n }\n\n end = performance.now();\n console.log(`Execution time load wordsRangeCollections: ${end - start} ms`);\n start = performance.now();\n\n const wordChars = [];\n\n for (let i = 0; i < wordsRangeCollections.length; i++) {\n const wordsRangeCollection = wordsRangeCollections[i];\n\n for (let j = 0; j < wordsRangeCollection.items.length; j++) {\n const wordRange = wordsRangeCollection.items[j];\n\n const wordChar = wordRange.getRange().split([\"\"]);\n\n wordChar.load(\"$none\");\n wordChars.push(wordChar);\n //wordChar.untrack();\n }\n }\n\n document.getElementById(\"progressbar\").style.width = \"30%\";\n\n end = performance.now();\n console.log(`Execution time load wordChars: ${end - start} ms`);\n start = performance.now();\n\n document.getElementById(\"progressbar\").style.width = \"40%\";\n\n try {\n await context.sync();\n } catch (error) {\n console.error(\"error on sync2 - \" + error);\n }\n\n document.getElementById(\"progressbar\").style.width = \"50%\";\n\n for (let j = 0; j < wordChars.length; j++) {\n const wordChar = wordChars[j];\n try {\n if (wordChar) {\n if (wordChar.items.length > 2) {\n wordChar.items[1].font.bold = true;\n wordChar.items[2].font.bold = true;\n }\n }\n } catch (error) {\n console.error(\"error on process - \" + error);\n }\n }\n\n // Synchronize the document state.\n\n document.getElementById(\"progressbar\").style.width = \"60%\";\n\n end = performance.now();\n console.log(`Execution time update word formatting: ${end - start} ms`);\n start = performance.now();\n\n await context.sync();\n\n end = performance.now();\n console.log(`Execution time context sync: ${end - start} ms`);\n\n document.getElementById(\"progressbar\").style.width = \"100%\";\n document.getElementById(\"progressbox\").style.display = \"none\";\n });\n}\n\nexport async function run2() {\n console.log(`Run V2 - (V${addinVersion})`);\n return await Word.run(async (context) => {\n const start = performance.now();\n\n document.getElementById(\"progressbox\").style.display = \"block\";\n document.getElementById(\"progressbar\").style.width = \"0%\";\n\n const paragraphs = context.document.body.paragraphs;\n\n // load text\n paragraphs.load(\"$all\");\n //paragraphs.load([\"text\", \"items\"]);\n //await context.sync();\n await paragraphs.context.sync();\n\n document.getElementById(\"progressbar\").style.width = \"10%\";\n\n for (let i = 0; i < paragraphs.items.length; i++) {\n const paragraph = paragraphs.items[i];\n\n const percentage = (100 * i) / paragraphs.items.length;\n document.getElementById(\"progressbar\").style.width = percentage + \"%\";\n\n // only process if text available\n if (paragraph.text) {\n const wordsRangeCollection = paragraph.getRange().split([\" \"]);\n wordsRangeCollection.load(\"$none\");\n\n await wordsRangeCollection.context.sync();\n\n const wordChars = [];\n\n for (let j = 0; j < wordsRangeCollection.items.length; j++) {\n const wordRange = wordsRangeCollection.items[j];\n\n const wordChar = wordRange.getRange().split([\"\"]);\n\n //wordChar.load(\"font\");\n wordChar.load(\"$none\");\n\n wordChars.push(wordChar);\n }\n\n try {\n await context.sync();\n } catch (error) {\n console.error(\"error on sync - \" + error);\n continue;\n }\n\n for (let j = 0; j < wordChars.length; j++) {\n const wordChar = wordChars[j];\n\n if (wordChar) {\n if (wordChar.items.length > 2) {\n wordChar.items[1].font.bold = true;\n wordChar.items[2].font.bold = true;\n }\n }\n }\n }\n }\n\n // Synchronize the document state.\n await context.sync();\n\n const end = performance.now();\n console.log(`Execution time: ${end - start} ms`);\n\n document.getElementById(\"progressbar\").style.width = \"100%\";\n document.getElementById(\"progressbox\").style.display = \"none\";\n });\n}\n"],"names":["___HTML_LOADER_IMPORT_0___","___HTML_LOADER_IMPORT_1___","module","exports","url","options","String","__esModule","default","hash","maybeNeedQuotes","test","concat","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","n","getter","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","src","scripts","getElementsByTagName","length","i","Error","replace","p","b","baseURI","self","href","addinVersion","async","insertTextIntoRange","Word","run","start","performance","now","paragraphs","context","body","load","sync","console","log","items","words1","x","paragraph","words","getTextRanges","push","chars1","charRanges","search","matchWildcards","z","font","bold","end","run1","getElementById","style","display","width","wordsRangeCollections","text","wordsRangeCollection","getRange","split","error","wordChars","j","wordChar","run2","percentage","Office","onReady","info","host","HostType","onclick","URL"],"sourceRoot":""} \ No newline at end of file