@orca-pt/orca-components 1.0.2 → 1.0.4
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/components/renderers/OrcaHtml.vue.d.ts +13 -0
- package/dist/index.d.ts +1 -1
- package/dist/orca-components.css +1 -1
- package/dist/orca-components.es.js +203 -63
- package/dist/orca-components.es.js.map +1 -1
- package/dist/orca-components.umd.js +1 -1
- package/dist/orca-components.umd.js.map +1 -1
- package/dist/types/index.d.ts +7 -3
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, unref, ref, watch, onMounted, nextTick, defineComponent, createElementBlock, openBlock, createElementVNode, createStaticVNode, createVNode, Fragment, renderList, toDisplayString, createTextVNode, onUnmounted, createBlock, withCtx, createCommentVNode, normalizeStyle, normalizeClass, createSlots, Transition, isRef, withModifiers } from "vue";
|
|
1
|
+
import { computed, unref, ref, watch, onMounted, nextTick, defineComponent, createElementBlock, openBlock, createElementVNode, createStaticVNode, createVNode, Fragment, renderList, toDisplayString, createTextVNode, onUnmounted, createBlock, withCtx, createCommentVNode, normalizeStyle, normalizeClass, createSlots, useCssVars, Transition, isRef, withModifiers } from "vue";
|
|
2
2
|
import { VCard, VImg, VCardItem, VCardTitle, VBtn, VIcon, VExpandTransition, VProgressCircular, VDialog } from "vuetify/components";
|
|
3
3
|
import MarkdownIt from "markdown-it";
|
|
4
4
|
import hljs from "highlight.js";
|
|
@@ -167,6 +167,11 @@ const MARKERS = [
|
|
|
167
167
|
start: "[orca.loading.map.start]",
|
|
168
168
|
end: "[orca.loading.map.end]"
|
|
169
169
|
},
|
|
170
|
+
{
|
|
171
|
+
type: "html-loading",
|
|
172
|
+
start: "[orca.loading.html.start]",
|
|
173
|
+
end: "[orca.loading.html.end]"
|
|
174
|
+
},
|
|
170
175
|
// Content markers
|
|
171
176
|
{ type: "image", start: "[orca.image.start]", end: "[orca.image.end]" },
|
|
172
177
|
{ type: "video", start: "[orca.video.start]", end: "[orca.video.end]" },
|
|
@@ -195,7 +200,8 @@ const MARKERS = [
|
|
|
195
200
|
start: "[orca.tracing.start]",
|
|
196
201
|
end: "[orca.tracing.end]"
|
|
197
202
|
},
|
|
198
|
-
{ type: "audio", start: "[orca.audio.start]", end: "[orca.audio.end]" }
|
|
203
|
+
{ type: "audio", start: "[orca.audio.start]", end: "[orca.audio.end]" },
|
|
204
|
+
{ type: "html", start: "[orca.html.start]", end: "[orca.html.end]" }
|
|
199
205
|
];
|
|
200
206
|
const GENERAL_LOADING_TYPES = [
|
|
201
207
|
"general-loading",
|
|
@@ -387,7 +393,7 @@ function parseTracing(payload) {
|
|
|
387
393
|
function isLoadingType$1(type) {
|
|
388
394
|
return type.includes("-loading");
|
|
389
395
|
}
|
|
390
|
-
const SIMPLE_CONTENT_TYPES = ["image", "video", "youtube"];
|
|
396
|
+
const SIMPLE_CONTENT_TYPES = ["image", "video", "youtube", "html"];
|
|
391
397
|
const PARSER_MAP = {
|
|
392
398
|
card: parseCard,
|
|
393
399
|
location: parseLocation,
|
|
@@ -883,10 +889,10 @@ function useMarkdown() {
|
|
|
883
889
|
};
|
|
884
890
|
return { render };
|
|
885
891
|
}
|
|
886
|
-
const _hoisted_1$
|
|
887
|
-
const _hoisted_2$
|
|
888
|
-
const _hoisted_3$
|
|
889
|
-
const _sfc_main$
|
|
892
|
+
const _hoisted_1$f = { class: "image-container tw-my-4" };
|
|
893
|
+
const _hoisted_2$b = { class: "image-wrapper" };
|
|
894
|
+
const _hoisted_3$8 = ["src"];
|
|
895
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
890
896
|
__name: "OrcaImage",
|
|
891
897
|
props: {
|
|
892
898
|
url: {}
|
|
@@ -899,15 +905,15 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
899
905
|
emit("open-modal", props.url);
|
|
900
906
|
};
|
|
901
907
|
return (_ctx, _cache) => {
|
|
902
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
903
|
-
createElementVNode("div", _hoisted_2$
|
|
908
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
909
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
904
910
|
createElementVNode("img", {
|
|
905
911
|
src: __props.url,
|
|
906
912
|
alt: "Generated image",
|
|
907
913
|
class: "orca-image",
|
|
908
914
|
loading: "lazy",
|
|
909
915
|
onClick: openModal
|
|
910
|
-
}, null, 8, _hoisted_3$
|
|
916
|
+
}, null, 8, _hoisted_3$8),
|
|
911
917
|
_cache[0] || (_cache[0] = createStaticVNode('<div class="image-overlay" data-v-e4f9d4c4><div class="zoom-icon" data-v-e4f9d4c4><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-e4f9d4c4><circle cx="11" cy="11" r="8" data-v-e4f9d4c4></circle><path d="m21 21-4.35-4.35" data-v-e4f9d4c4></path><line x1="11" y1="8" x2="11" y2="14" data-v-e4f9d4c4></line><line x1="8" y1="11" x2="14" y2="11" data-v-e4f9d4c4></line></svg></div></div>', 1))
|
|
912
918
|
])
|
|
913
919
|
]);
|
|
@@ -921,10 +927,10 @@ const _export_sfc = (sfc, props) => {
|
|
|
921
927
|
}
|
|
922
928
|
return target;
|
|
923
929
|
};
|
|
924
|
-
const OrcaImage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
925
|
-
const _hoisted_1$
|
|
926
|
-
const _hoisted_2$
|
|
927
|
-
const _sfc_main$
|
|
930
|
+
const OrcaImage = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-e4f9d4c4"]]);
|
|
931
|
+
const _hoisted_1$e = { class: "orca-video-container" };
|
|
932
|
+
const _hoisted_2$a = { class: "video-wrapper" };
|
|
933
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
928
934
|
__name: "OrcaVideo",
|
|
929
935
|
props: {
|
|
930
936
|
url: {}
|
|
@@ -943,8 +949,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
943
949
|
]
|
|
944
950
|
});
|
|
945
951
|
return (_ctx, _cache) => {
|
|
946
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
947
|
-
createElementVNode("div", _hoisted_2$
|
|
952
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
953
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
948
954
|
createVNode(unref(VideoPlayer), {
|
|
949
955
|
options: {
|
|
950
956
|
...videoOptions.value,
|
|
@@ -962,11 +968,11 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
962
968
|
};
|
|
963
969
|
}
|
|
964
970
|
});
|
|
965
|
-
const OrcaVideo = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
966
|
-
const _hoisted_1$
|
|
967
|
-
const _hoisted_2$
|
|
968
|
-
const _hoisted_3$
|
|
969
|
-
const _sfc_main$
|
|
971
|
+
const OrcaVideo = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-7a20a30c"]]);
|
|
972
|
+
const _hoisted_1$d = { class: "orca-youtube-container" };
|
|
973
|
+
const _hoisted_2$9 = { class: "youtube-wrapper" };
|
|
974
|
+
const _hoisted_3$7 = ["src"];
|
|
975
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
970
976
|
__name: "OrcaYouTube",
|
|
971
977
|
props: {
|
|
972
978
|
url: {}
|
|
@@ -978,8 +984,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
978
984
|
return `https://www.youtube.com/embed/${videoId}`;
|
|
979
985
|
});
|
|
980
986
|
return (_ctx, _cache) => {
|
|
981
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
982
|
-
createElementVNode("div", _hoisted_2$
|
|
987
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
988
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
983
989
|
createElementVNode("iframe", {
|
|
984
990
|
width: "100%",
|
|
985
991
|
height: "100%",
|
|
@@ -988,28 +994,28 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
988
994
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
989
995
|
allowfullscreen: "",
|
|
990
996
|
class: "youtube-iframe"
|
|
991
|
-
}, null, 8, _hoisted_3$
|
|
997
|
+
}, null, 8, _hoisted_3$7)
|
|
992
998
|
])
|
|
993
999
|
]);
|
|
994
1000
|
};
|
|
995
1001
|
}
|
|
996
1002
|
});
|
|
997
|
-
const OrcaYouTube = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
998
|
-
const _hoisted_1$
|
|
999
|
-
const _hoisted_2$
|
|
1000
|
-
const _hoisted_3$
|
|
1003
|
+
const OrcaYouTube = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-9cd52c38"]]);
|
|
1004
|
+
const _hoisted_1$c = { class: "orca-audio-container" };
|
|
1005
|
+
const _hoisted_2$8 = { class: "audio-list" };
|
|
1006
|
+
const _hoisted_3$6 = { class: "audio-content" };
|
|
1001
1007
|
const _hoisted_4$4 = { class: "audio-label" };
|
|
1002
1008
|
const _hoisted_5 = ["type"];
|
|
1003
1009
|
const _hoisted_6 = ["src", "type"];
|
|
1004
|
-
const _sfc_main$
|
|
1010
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1005
1011
|
__name: "OrcaAudio",
|
|
1006
1012
|
props: {
|
|
1007
1013
|
audioItems: {}
|
|
1008
1014
|
},
|
|
1009
1015
|
setup(__props) {
|
|
1010
1016
|
return (_ctx, _cache) => {
|
|
1011
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1012
|
-
createElementVNode("div", _hoisted_2$
|
|
1017
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1018
|
+
createElementVNode("div", _hoisted_2$8, [
|
|
1013
1019
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.audioItems, (audio, audioIndex) => {
|
|
1014
1020
|
return openBlock(), createElementBlock("div", {
|
|
1015
1021
|
key: audioIndex,
|
|
@@ -1030,7 +1036,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1030
1036
|
})
|
|
1031
1037
|
])
|
|
1032
1038
|
], -1)),
|
|
1033
|
-
createElementVNode("div", _hoisted_3$
|
|
1039
|
+
createElementVNode("div", _hoisted_3$6, [
|
|
1034
1040
|
createElementVNode("p", _hoisted_4$4, toDisplayString(audio.label), 1),
|
|
1035
1041
|
createElementVNode("audio", {
|
|
1036
1042
|
controls: "",
|
|
@@ -1051,12 +1057,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1051
1057
|
};
|
|
1052
1058
|
}
|
|
1053
1059
|
});
|
|
1054
|
-
const OrcaAudio = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1055
|
-
const _hoisted_1$
|
|
1056
|
-
const _hoisted_2$
|
|
1057
|
-
const _hoisted_3$
|
|
1060
|
+
const OrcaAudio = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-ade9342b"]]);
|
|
1061
|
+
const _hoisted_1$b = { class: "orca-location-container" };
|
|
1062
|
+
const _hoisted_2$7 = { class: "map-wrapper" };
|
|
1063
|
+
const _hoisted_3$5 = { class: "location-info" };
|
|
1058
1064
|
const _hoisted_4$3 = { class: "location-text" };
|
|
1059
|
-
const _sfc_main$
|
|
1065
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1060
1066
|
__name: "OrcaLocation",
|
|
1061
1067
|
props: {
|
|
1062
1068
|
latitude: {},
|
|
@@ -1119,15 +1125,15 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1119
1125
|
}
|
|
1120
1126
|
});
|
|
1121
1127
|
return (_ctx, _cache) => {
|
|
1122
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1123
|
-
createElementVNode("div", _hoisted_2$
|
|
1128
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1129
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
1124
1130
|
(openBlock(), createElementBlock("div", {
|
|
1125
1131
|
ref: (el) => onMapContainerReady(el),
|
|
1126
1132
|
class: "map-container",
|
|
1127
1133
|
key: `map-${__props.latitude}-${__props.longitude}`
|
|
1128
1134
|
}))
|
|
1129
1135
|
]),
|
|
1130
|
-
createElementVNode("div", _hoisted_3$
|
|
1136
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
1131
1137
|
_cache[0] || (_cache[0] = createElementVNode("div", { class: "location-icon" }, [
|
|
1132
1138
|
createElementVNode("svg", {
|
|
1133
1139
|
width: "16",
|
|
@@ -1151,13 +1157,13 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1151
1157
|
};
|
|
1152
1158
|
}
|
|
1153
1159
|
});
|
|
1154
|
-
const OrcaLocation = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1155
|
-
const _hoisted_1$
|
|
1156
|
-
const _hoisted_2$
|
|
1160
|
+
const OrcaLocation = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-99a42606"]]);
|
|
1161
|
+
const _hoisted_1$a = { class: "orca-card-container" };
|
|
1162
|
+
const _hoisted_2$6 = {
|
|
1157
1163
|
key: 0,
|
|
1158
1164
|
class: "card-image-wrapper"
|
|
1159
1165
|
};
|
|
1160
|
-
const _hoisted_3$
|
|
1166
|
+
const _hoisted_3$4 = {
|
|
1161
1167
|
key: 1,
|
|
1162
1168
|
class: "card-subheader"
|
|
1163
1169
|
};
|
|
@@ -1165,14 +1171,14 @@ const _hoisted_4$2 = {
|
|
|
1165
1171
|
key: 2,
|
|
1166
1172
|
class: "card-text"
|
|
1167
1173
|
};
|
|
1168
|
-
const _sfc_main$
|
|
1174
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1169
1175
|
__name: "OrcaCardList",
|
|
1170
1176
|
props: {
|
|
1171
1177
|
cards: {}
|
|
1172
1178
|
},
|
|
1173
1179
|
setup(__props) {
|
|
1174
1180
|
return (_ctx, _cache) => {
|
|
1175
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1181
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1176
1182
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.cards, (card, i) => {
|
|
1177
1183
|
return openBlock(), createBlock(unref(VCard), {
|
|
1178
1184
|
key: i,
|
|
@@ -1180,7 +1186,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1180
1186
|
elevation: "2"
|
|
1181
1187
|
}, {
|
|
1182
1188
|
default: withCtx(() => [
|
|
1183
|
-
card.photo ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
1189
|
+
card.photo ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
1184
1190
|
createVNode(unref(VImg), {
|
|
1185
1191
|
src: card.photo,
|
|
1186
1192
|
height: "223",
|
|
@@ -1199,7 +1205,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1199
1205
|
]),
|
|
1200
1206
|
_: 2
|
|
1201
1207
|
}, 1024)) : createCommentVNode("", true),
|
|
1202
|
-
card.subheader ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
1208
|
+
card.subheader ? (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(card.subheader), 1)) : createCommentVNode("", true),
|
|
1203
1209
|
card.text ? (openBlock(), createElementBlock("p", _hoisted_4$2, toDisplayString(card.text), 1)) : createCommentVNode("", true)
|
|
1204
1210
|
]),
|
|
1205
1211
|
_: 2
|
|
@@ -1212,9 +1218,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1212
1218
|
};
|
|
1213
1219
|
}
|
|
1214
1220
|
});
|
|
1215
|
-
const OrcaCardList = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1216
|
-
const _hoisted_1$
|
|
1217
|
-
const _sfc_main$
|
|
1221
|
+
const OrcaCardList = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-d9e3b93c"]]);
|
|
1222
|
+
const _hoisted_1$9 = { class: "orca-buttons-container tw-my-4" };
|
|
1223
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1218
1224
|
__name: "OrcaButtons",
|
|
1219
1225
|
props: {
|
|
1220
1226
|
buttons: {},
|
|
@@ -1231,7 +1237,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1231
1237
|
}
|
|
1232
1238
|
};
|
|
1233
1239
|
return (_ctx, _cache) => {
|
|
1234
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1240
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1235
1241
|
(openBlock(true), createElementBlock(Fragment, null, renderList(groupedButtons.value, (row, rowIndex) => {
|
|
1236
1242
|
return openBlock(), createElementBlock("div", {
|
|
1237
1243
|
key: rowIndex,
|
|
@@ -1275,18 +1281,18 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1275
1281
|
};
|
|
1276
1282
|
}
|
|
1277
1283
|
});
|
|
1278
|
-
const OrcaButtons = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1279
|
-
const _hoisted_1$
|
|
1284
|
+
const OrcaButtons = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-480c6090"]]);
|
|
1285
|
+
const _hoisted_1$8 = {
|
|
1280
1286
|
key: 0,
|
|
1281
1287
|
class: "orca-trace-container"
|
|
1282
1288
|
};
|
|
1283
|
-
const _hoisted_2$
|
|
1284
|
-
const _hoisted_3$
|
|
1289
|
+
const _hoisted_2$5 = { class: "trace-header" };
|
|
1290
|
+
const _hoisted_3$3 = {
|
|
1285
1291
|
key: 0,
|
|
1286
1292
|
class: "trace-content"
|
|
1287
1293
|
};
|
|
1288
1294
|
const _hoisted_4$1 = { class: "trace-pre" };
|
|
1289
|
-
const _sfc_main$
|
|
1295
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1290
1296
|
__name: "OrcaTracing",
|
|
1291
1297
|
props: {
|
|
1292
1298
|
tracingData: {},
|
|
@@ -1315,13 +1321,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1315
1321
|
traceVisible.value = !traceVisible.value;
|
|
1316
1322
|
};
|
|
1317
1323
|
return (_ctx, _cache) => {
|
|
1318
|
-
return shouldShow.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1324
|
+
return shouldShow.value ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1319
1325
|
createVNode(unref(VCard), {
|
|
1320
1326
|
class: "trace-card",
|
|
1321
1327
|
elevation: "2"
|
|
1322
1328
|
}, {
|
|
1323
1329
|
default: withCtx(() => [
|
|
1324
|
-
createElementVNode("div", _hoisted_2$
|
|
1330
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
1325
1331
|
_cache[0] || (_cache[0] = createElementVNode("div", { class: "trace-header-content" }, [
|
|
1326
1332
|
createElementVNode("div", { class: "trace-icon" }, [
|
|
1327
1333
|
createElementVNode("svg", {
|
|
@@ -1352,7 +1358,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1352
1358
|
]),
|
|
1353
1359
|
createVNode(unref(VExpandTransition), null, {
|
|
1354
1360
|
default: withCtx(() => [
|
|
1355
|
-
isVisible.value ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1361
|
+
isVisible.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
1356
1362
|
createElementVNode("pre", _hoisted_4$1, toDisplayString(tracingContent.value), 1)
|
|
1357
1363
|
])) : createCommentVNode("", true)
|
|
1358
1364
|
]),
|
|
@@ -1365,7 +1371,138 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1365
1371
|
};
|
|
1366
1372
|
}
|
|
1367
1373
|
});
|
|
1368
|
-
const OrcaTracing = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1374
|
+
const OrcaTracing = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-69e262d5"]]);
|
|
1375
|
+
const _hoisted_1$7 = { class: "orca-html-container" };
|
|
1376
|
+
const _hoisted_2$4 = { class: "html-wrapper" };
|
|
1377
|
+
const _hoisted_3$2 = ["srcdoc"];
|
|
1378
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1379
|
+
__name: "OrcaHtml",
|
|
1380
|
+
props: {
|
|
1381
|
+
content: {}
|
|
1382
|
+
},
|
|
1383
|
+
setup(__props) {
|
|
1384
|
+
useCssVars((_ctx) => ({
|
|
1385
|
+
"v22560b2d": iframeHeight.value + "px"
|
|
1386
|
+
}));
|
|
1387
|
+
const props = __props;
|
|
1388
|
+
const iframeRef = ref(null);
|
|
1389
|
+
const iframeHeight = ref(400);
|
|
1390
|
+
const sanitizeContent = (content) => {
|
|
1391
|
+
let sanitized = content.replace(/<\?xml[^?]*\?>/gi, "");
|
|
1392
|
+
sanitized = sanitized.replace(/<!DOCTYPE[^>]*>/gi, "");
|
|
1393
|
+
return sanitized.trim();
|
|
1394
|
+
};
|
|
1395
|
+
const wrappedHtml = computed(() => {
|
|
1396
|
+
return `
|
|
1397
|
+
<!DOCTYPE html>
|
|
1398
|
+
<html>
|
|
1399
|
+
<head>
|
|
1400
|
+
<meta charset="UTF-8">
|
|
1401
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1402
|
+
<style>
|
|
1403
|
+
* {
|
|
1404
|
+
box-sizing: border-box;
|
|
1405
|
+
}
|
|
1406
|
+
html, body {
|
|
1407
|
+
margin: 0;
|
|
1408
|
+
padding: 0;
|
|
1409
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
1410
|
+
background: transparent;
|
|
1411
|
+
overflow: hidden;
|
|
1412
|
+
}
|
|
1413
|
+
body {
|
|
1414
|
+
padding: 8px;
|
|
1415
|
+
}
|
|
1416
|
+
/* SVG responsiveness for matplotlib */
|
|
1417
|
+
svg {
|
|
1418
|
+
max-width: 100%;
|
|
1419
|
+
height: auto;
|
|
1420
|
+
}
|
|
1421
|
+
/* Plotly container responsiveness */
|
|
1422
|
+
.plotly-graph-div {
|
|
1423
|
+
width: 100% !important;
|
|
1424
|
+
}
|
|
1425
|
+
</style>
|
|
1426
|
+
</head>
|
|
1427
|
+
<body>
|
|
1428
|
+
${sanitizeContent(props.content)}
|
|
1429
|
+
<script>
|
|
1430
|
+
// Auto-resize iframe based on content
|
|
1431
|
+
function sendHeight() {
|
|
1432
|
+
const height = Math.max(
|
|
1433
|
+
document.body.scrollHeight,
|
|
1434
|
+
document.body.offsetHeight,
|
|
1435
|
+
document.documentElement.scrollHeight,
|
|
1436
|
+
document.documentElement.offsetHeight
|
|
1437
|
+
);
|
|
1438
|
+
window.parent.postMessage({ type: 'orca-html-resize', height: height + 16 }, '*');
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
// Initial send
|
|
1442
|
+
setTimeout(sendHeight, 100);
|
|
1443
|
+
|
|
1444
|
+
// Send on resize
|
|
1445
|
+
window.addEventListener('resize', sendHeight);
|
|
1446
|
+
|
|
1447
|
+
// Send when images/content loads
|
|
1448
|
+
document.addEventListener('DOMContentLoaded', sendHeight);
|
|
1449
|
+
window.addEventListener('load', sendHeight);
|
|
1450
|
+
|
|
1451
|
+
// Observe DOM changes for dynamic content (like Plotly)
|
|
1452
|
+
const observer = new MutationObserver(sendHeight);
|
|
1453
|
+
observer.observe(document.body, { childList: true, subtree: true, attributes: true });
|
|
1454
|
+
<\/script>
|
|
1455
|
+
</body>
|
|
1456
|
+
</html>`;
|
|
1457
|
+
});
|
|
1458
|
+
const handleIframeLoad = () => {
|
|
1459
|
+
adjustHeight();
|
|
1460
|
+
};
|
|
1461
|
+
const adjustHeight = () => {
|
|
1462
|
+
if (iframeRef.value) {
|
|
1463
|
+
try {
|
|
1464
|
+
const doc = iframeRef.value.contentDocument;
|
|
1465
|
+
if (doc && doc.body) {
|
|
1466
|
+
const height = Math.max(doc.body.scrollHeight, doc.body.offsetHeight);
|
|
1467
|
+
if (height > 0) {
|
|
1468
|
+
iframeHeight.value = height + 16;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
} catch (e) {
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
const handleMessage = (event) => {
|
|
1476
|
+
if (event.data && event.data.type === "orca-html-resize") {
|
|
1477
|
+
const newHeight = event.data.height;
|
|
1478
|
+
if (newHeight && newHeight > 0) {
|
|
1479
|
+
iframeHeight.value = Math.min(newHeight, 800);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
onMounted(() => {
|
|
1484
|
+
window.addEventListener("message", handleMessage);
|
|
1485
|
+
});
|
|
1486
|
+
onUnmounted(() => {
|
|
1487
|
+
window.removeEventListener("message", handleMessage);
|
|
1488
|
+
});
|
|
1489
|
+
return (_ctx, _cache) => {
|
|
1490
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1491
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
1492
|
+
createElementVNode("iframe", {
|
|
1493
|
+
ref_key: "iframeRef",
|
|
1494
|
+
ref: iframeRef,
|
|
1495
|
+
srcdoc: wrappedHtml.value,
|
|
1496
|
+
sandbox: "allow-scripts",
|
|
1497
|
+
class: "html-iframe",
|
|
1498
|
+
onLoad: handleIframeLoad
|
|
1499
|
+
}, null, 40, _hoisted_3$2)
|
|
1500
|
+
])
|
|
1501
|
+
]);
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
const OrcaHtml = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-c4d7eb31"]]);
|
|
1369
1506
|
const _hoisted_1$6 = ["innerHTML"];
|
|
1370
1507
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1371
1508
|
__name: "ContentElement",
|
|
@@ -1423,7 +1560,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1423
1560
|
"tracing-data": __props.element.content,
|
|
1424
1561
|
visibility: __props.visibility,
|
|
1425
1562
|
"is-admin": __props.isAdmin
|
|
1426
|
-
}, null, 8, ["tracing-data", "visibility", "is-admin"])) :
|
|
1563
|
+
}, null, 8, ["tracing-data", "visibility", "is-admin"])) : __props.element.type === "html" ? (openBlock(), createBlock(OrcaHtml, {
|
|
1564
|
+
key: 9,
|
|
1565
|
+
content: __props.element.content
|
|
1566
|
+
}, null, 8, ["content"])) : createCommentVNode("", true)
|
|
1427
1567
|
]);
|
|
1428
1568
|
};
|
|
1429
1569
|
}
|
|
@@ -1828,7 +1968,7 @@ const OrcaMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data
|
|
|
1828
1968
|
const version = "1.0.2";
|
|
1829
1969
|
const packageInfo = {
|
|
1830
1970
|
name: "@orca-pt/orca-components",
|
|
1831
|
-
|
|
1971
|
+
undefined: void 0,
|
|
1832
1972
|
description: "Orca native components for rendering special content markers",
|
|
1833
1973
|
author: "Orca Team"
|
|
1834
1974
|
};
|