@valiantys/atlassian-app-frontend 3.0.0-alpha-6 → 3.0.0-alpha-7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valiantys/atlassian-app-frontend",
3
- "version": "3.0.0-alpha-6",
3
+ "version": "3.0.0-alpha-7",
4
4
  "description": "This library provides an Atlassian Forge Custom UI wrapper component that handles all the setup necessary to support an app that can run deployed or in standalone mode",
5
5
  "exports": {
6
6
  "./atlassian-app": {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}function l(t){var n;const r=new DOMParser().parseFromString(t.html,"text/html").getElementsByTagName("a")[0];if(!r)throw new Error("Invalid link format");const o=i(r.getAttribute("href")||""),a=((n=r.textContent)==null?void 0:n.trim())||"";return{href:o,text:a}}exports.parseDroppedHtmlLink=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}function l(t){return a(t)[0]}function a(t){const r=new DOMParser().parseFromString(t.html,"text/html").getElementsByTagName("a");if(!r.length)throw new Error("Invalid link format");return Array.from(r).map(n=>{var o;const s=m(n.getAttribute("href")||""),i=((o=n.textContent)==null?void 0:o.trim())||"";return{href:s,text:i}})}exports.parseDroppedHtmlLink=l;exports.parseDroppedHtmlLinks=a;
@@ -1,18 +1,24 @@
1
- function c(t) {
1
+ function s(t) {
2
2
  const e = document.createElement("textarea");
3
3
  return e.innerHTML = t, e.value;
4
4
  }
5
- function m(t) {
6
- var n;
7
- const r = new DOMParser().parseFromString(t.html, "text/html").getElementsByTagName("a")[0];
8
- if (!r)
5
+ function l(t) {
6
+ return c(t)[0];
7
+ }
8
+ function c(t) {
9
+ const r = new DOMParser().parseFromString(t.html, "text/html").getElementsByTagName("a");
10
+ if (!r.length)
9
11
  throw new Error("Invalid link format");
10
- const o = c(r.getAttribute("href") || ""), a = ((n = r.textContent) == null ? void 0 : n.trim()) || "";
11
- return {
12
- href: o,
13
- text: a
14
- };
12
+ return Array.from(r).map((n) => {
13
+ var o;
14
+ const a = s(n.getAttribute("href") || ""), m = ((o = n.textContent) == null ? void 0 : o.trim()) || "";
15
+ return {
16
+ href: a,
17
+ text: m
18
+ };
19
+ });
15
20
  }
16
21
  export {
17
- m as parseDroppedHtmlLink
22
+ l as parseDroppedHtmlLink,
23
+ c as parseDroppedHtmlLinks
18
24
  };
@@ -536,7 +536,7 @@
536
536
  {
537
537
  "kind": "Function",
538
538
  "canonicalReference": "@valiantys/atlassian-app-frontend!parseDroppedHtmlLink:function(1)",
539
- "docComment": "/**\n * This function is for parsing html link anchor tags that have been drag/dropped.\n *\n * @param linkItem - A 'text/html' drop item\n */\n",
539
+ "docComment": "/**\n * This function is for parsing html link anchor tags that have been drag/dropped.\n *\n * @param linkItem - A 'text/html' drop item @return An array of ParsedLink\n */\n",
540
540
  "excerptTokens": [
541
541
  {
542
542
  "kind": "Content",
@@ -579,6 +579,57 @@
579
579
  }
580
580
  ],
581
581
  "name": "parseDroppedHtmlLink"
582
+ },
583
+ {
584
+ "kind": "Function",
585
+ "canonicalReference": "@valiantys/atlassian-app-frontend!parseDroppedHtmlLinks:function(1)",
586
+ "docComment": "/**\n * This function is for parsing html link anchor tags that have been drag/dropped.\n *\n * @param linkItem - A 'text/html' drop item @return An array of ParsedLink\n */\n",
587
+ "excerptTokens": [
588
+ {
589
+ "kind": "Content",
590
+ "text": "export declare function parseDroppedHtmlLinks(linkItem: "
591
+ },
592
+ {
593
+ "kind": "Reference",
594
+ "text": "HtmlDropItem",
595
+ "canonicalReference": "@valiantys/atlassian-app-frontend!HtmlDropItem:interface"
596
+ },
597
+ {
598
+ "kind": "Content",
599
+ "text": "): "
600
+ },
601
+ {
602
+ "kind": "Reference",
603
+ "text": "ParsedLink",
604
+ "canonicalReference": "@valiantys/atlassian-app-frontend!ParsedLink:interface"
605
+ },
606
+ {
607
+ "kind": "Content",
608
+ "text": "[]"
609
+ },
610
+ {
611
+ "kind": "Content",
612
+ "text": ";"
613
+ }
614
+ ],
615
+ "fileUrlPath": "../../../shared/frontend-ui-drop-target/src/lib/drop-utils.d.ts",
616
+ "returnTypeTokenRange": {
617
+ "startIndex": 3,
618
+ "endIndex": 5
619
+ },
620
+ "releaseTag": "Public",
621
+ "overloadIndex": 1,
622
+ "parameters": [
623
+ {
624
+ "parameterName": "linkItem",
625
+ "parameterTypeTokenRange": {
626
+ "startIndex": 1,
627
+ "endIndex": 2
628
+ },
629
+ "isOptional": false
630
+ }
631
+ ],
632
+ "name": "parseDroppedHtmlLinks"
582
633
  }
583
634
  ]
584
635
  }
@@ -42,6 +42,9 @@ export interface ParsedLink {
42
42
  // @public
43
43
  export function parseDroppedHtmlLink(linkItem: HtmlDropItem): ParsedLink;
44
44
 
45
+ // @public
46
+ export function parseDroppedHtmlLinks(linkItem: HtmlDropItem): ParsedLink[];
47
+
45
48
  // (No @packageDocumentation comment for this package)
46
49
 
47
50
  ```
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../shared/frontend-ui-drop-target/src/lib/drop-utils/index.cjs.js"),e=require("../shared/frontend-ui-drop-target/src/lib/drop-target-box/index.cjs.js");exports.parseDroppedHtmlLink=r.parseDroppedHtmlLink;exports.DropTargetBox=e.DropTargetBox;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../shared/frontend-ui-drop-target/src/lib/drop-utils/index.cjs.js"),e=require("../shared/frontend-ui-drop-target/src/lib/drop-target-box/index.cjs.js");exports.parseDroppedHtmlLink=r.parseDroppedHtmlLink;exports.parseDroppedHtmlLinks=r.parseDroppedHtmlLinks;exports.DropTargetBox=e.DropTargetBox;
@@ -25,7 +25,15 @@ export declare interface ParsedLink {
25
25
  /**
26
26
  * This function is for parsing html link anchor tags that have been drag/dropped.
27
27
  * @param linkItem A 'text/html' drop item
28
+ * @return An array of ParsedLink
28
29
  */
29
30
  export declare function parseDroppedHtmlLink(linkItem: HtmlDropItem): ParsedLink;
30
31
 
32
+ /**
33
+ * This function is for parsing html link anchor tags that have been drag/dropped.
34
+ * @param linkItem A 'text/html' drop item
35
+ * @return An array of ParsedLink
36
+ */
37
+ export declare function parseDroppedHtmlLinks(linkItem: HtmlDropItem): ParsedLink[];
38
+
31
39
  export { }
@@ -1,6 +1,7 @@
1
- import { parseDroppedHtmlLink as p } from "../shared/frontend-ui-drop-target/src/lib/drop-utils/index.es.js";
2
- import { DropTargetBox as t } from "../shared/frontend-ui-drop-target/src/lib/drop-target-box/index.es.js";
1
+ import { parseDroppedHtmlLink as o, parseDroppedHtmlLinks as e } from "../shared/frontend-ui-drop-target/src/lib/drop-utils/index.es.js";
2
+ import { DropTargetBox as m } from "../shared/frontend-ui-drop-target/src/lib/drop-target-box/index.es.js";
3
3
  export {
4
- t as DropTargetBox,
5
- p as parseDroppedHtmlLink
4
+ m as DropTargetBox,
5
+ o as parseDroppedHtmlLink,
6
+ e as parseDroppedHtmlLinks
6
7
  };