@tailor-cms/ce-brightcove-video-display 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ declare global {
2
+ interface Window {
3
+ bc: any;
4
+ }
5
+ }
6
+ type __VLS_Props = {
7
+ accountId: string;
8
+ playerId: string;
9
+ videoId: string;
10
+ };
11
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {
12
+ pause: () => void;
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { Element } from '@tailor-cms/ce-brightcove-video-manifest';
2
+ type __VLS_Props = {
3
+ element: Element;
4
+ userState: any;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ interaction: (...args: any[]) => void;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onInteraction?: ((...args: any[]) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ export default _default;
package/dist/index.cjs CHANGED
@@ -129,7 +129,6 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
129
129
  const initPlayer = (url = playerUrl.value) => {
130
130
  destroyPlayer();
131
131
  script.value = loadScript(url, document.body, (err) => {
132
- var _a;
133
132
  if (err) {
134
133
  onError({
135
134
  code: BrightcoveErrorCode.INVALID_CONFIG,
@@ -140,7 +139,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
140
139
  }
141
140
  style.value = setTheme();
142
141
  const video = createPlayer();
143
- (_a = videoWrapper.value) == null ? void 0 : _a.appendChild(video);
142
+ videoWrapper.value?.appendChild(video);
144
143
  player.value = window.bc(video);
145
144
  player.value.autoplay(false);
146
145
  player.value.on("error", () => onError(player.value.error()));
@@ -224,35 +223,37 @@ const _export_sfc = (sfc, props) => {
224
223
  return target;
225
224
  };
226
225
  const BrightcovePlayer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-dd41e47c"]]);
227
- const _hoisted_1 = { class: "tce-root" };
226
+ const _hoisted_1 = { class: "tce-brightcove-video-root" };
228
227
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
229
228
  __name: "Display",
230
229
  props: {
231
- id: {},
232
- data: {},
230
+ element: {},
233
231
  userState: {}
234
232
  },
235
233
  emits: ["interaction"],
236
234
  setup(__props) {
237
235
  const props = __props;
236
+ const accountId = vue.computed(() => props.element.data.accountId);
237
+ const playerId = vue.computed(() => props.element.data.playerId);
238
+ const videoId = vue.computed(() => props.element.data.videoId);
238
239
  const isConfigured = vue.computed(
239
- () => props.data.accountId && props.data.playerId && props.data.videoId
240
+ () => accountId.value && playerId.value && videoId.value
240
241
  );
241
242
  return (_ctx, _cache) => {
242
243
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
243
244
  isConfigured.value ? (vue.openBlock(), vue.createBlock(BrightcovePlayer, {
244
245
  key: 0,
245
246
  ref: "player",
246
- "account-id": _ctx.data.accountId,
247
- "player-id": _ctx.data.playerId,
248
- "video-id": _ctx.data.videoId,
247
+ "account-id": accountId.value,
248
+ "player-id": playerId.value,
249
+ "video-id": videoId.value,
249
250
  class: "player"
250
251
  }, null, 8, ["account-id", "player-id", "video-id"])) : vue.createCommentVNode("", true)
251
252
  ]);
252
253
  };
253
254
  }
254
255
  });
255
- const Display = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5cbb7746"]]);
256
+ const Display = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d82c84d4"]]);
256
257
  const manifest = {
257
258
  ...index_default,
258
259
  Display
package/dist/index.css CHANGED
@@ -3,7 +3,5 @@
3
3
  width: 100%;
4
4
  height: 360px;
5
5
  }
6
- .tce-root[data-v-5cbb7746] {
7
- font-family: Arial, Helvetica, sans-serif;
8
- font-size: 1rem;
6
+ .tce-brightcove-video-root[data-v-d82c84d4] {
9
7
  }
@@ -0,0 +1,5 @@
1
+ import type { ElementManifest } from '@tailor-cms/ce-brightcove-video-manifest';
2
+ import Display from './components/Display.vue';
3
+ declare const manifest: ElementManifest;
4
+ export default manifest;
5
+ export { Display };
package/dist/index.js CHANGED
@@ -127,7 +127,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
127
127
  const initPlayer = (url = playerUrl.value) => {
128
128
  destroyPlayer();
129
129
  script.value = loadScript(url, document.body, (err) => {
130
- var _a;
131
130
  if (err) {
132
131
  onError({
133
132
  code: BrightcoveErrorCode.INVALID_CONFIG,
@@ -138,7 +137,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
138
137
  }
139
138
  style.value = setTheme();
140
139
  const video = createPlayer();
141
- (_a = videoWrapper.value) == null ? void 0 : _a.appendChild(video);
140
+ videoWrapper.value?.appendChild(video);
142
141
  player.value = window.bc(video);
143
142
  player.value.autoplay(false);
144
143
  player.value.on("error", () => onError(player.value.error()));
@@ -222,35 +221,37 @@ const _export_sfc = (sfc, props) => {
222
221
  return target;
223
222
  };
224
223
  const BrightcovePlayer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-dd41e47c"]]);
225
- const _hoisted_1 = { class: "tce-root" };
224
+ const _hoisted_1 = { class: "tce-brightcove-video-root" };
226
225
  const _sfc_main = /* @__PURE__ */ defineComponent({
227
226
  __name: "Display",
228
227
  props: {
229
- id: {},
230
- data: {},
228
+ element: {},
231
229
  userState: {}
232
230
  },
233
231
  emits: ["interaction"],
234
232
  setup(__props) {
235
233
  const props = __props;
234
+ const accountId = computed(() => props.element.data.accountId);
235
+ const playerId = computed(() => props.element.data.playerId);
236
+ const videoId = computed(() => props.element.data.videoId);
236
237
  const isConfigured = computed(
237
- () => props.data.accountId && props.data.playerId && props.data.videoId
238
+ () => accountId.value && playerId.value && videoId.value
238
239
  );
239
240
  return (_ctx, _cache) => {
240
241
  return openBlock(), createElementBlock("div", _hoisted_1, [
241
242
  isConfigured.value ? (openBlock(), createBlock(BrightcovePlayer, {
242
243
  key: 0,
243
244
  ref: "player",
244
- "account-id": _ctx.data.accountId,
245
- "player-id": _ctx.data.playerId,
246
- "video-id": _ctx.data.videoId,
245
+ "account-id": accountId.value,
246
+ "player-id": playerId.value,
247
+ "video-id": videoId.value,
247
248
  class: "player"
248
249
  }, null, 8, ["account-id", "player-id", "video-id"])) : createCommentVNode("", true)
249
250
  ]);
250
251
  };
251
252
  }
252
253
  });
253
- const Display = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5cbb7746"]]);
254
+ const Display = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d82c84d4"]]);
254
255
  const manifest = {
255
256
  ...index_default,
256
257
  Display
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Tailor CMS Brightcove video end-user component",
4
4
  "author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
5
5
  "type": "module",
6
- "version": "0.0.2",
6
+ "version": "0.1.0",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/index.js",
@@ -11,6 +11,7 @@
11
11
  }
12
12
  },
13
13
  "main": "./dist/index.cjs",
14
+ "types": "./types/index.d.ts",
14
15
  "files": [
15
16
  "dist"
16
17
  ],
@@ -18,16 +19,14 @@
18
19
  "vue": "^3.5.13"
19
20
  },
20
21
  "devDependencies": {
21
- "@tailor-cms/eslint-config": "0.0.2",
22
- "@types/lodash": "^4.17.12",
23
- "@vitejs/plugin-vue": "^5.2.1",
24
- "typescript": "^5.7.3",
25
- "vite": "^6.1.0",
26
- "vue-tsc": "^2.2.0",
27
- "@tailor-cms/ce-brightcove-video-manifest": "0.0.2"
22
+ "@tailor-cms/eslint-config": "1.1.2",
23
+ "@vitejs/plugin-vue": "^6.0.0",
24
+ "typescript": "^5.8.3",
25
+ "vite": "^7.0.3",
26
+ "vue-tsc": "^3.0.1",
27
+ "@tailor-cms/ce-brightcove-video-manifest": "0.1.0"
28
28
  },
29
29
  "dependencies": {
30
- "lodash": "^4.17.21",
31
30
  "url-join": "^5.0.0"
32
31
  },
33
32
  "publishConfig": {
@@ -35,8 +34,11 @@
35
34
  },
36
35
  "scripts": {
37
36
  "dev": "vite build --watch",
38
- "build": "vue-tsc --noEmit && vite build",
39
- "lint": "eslint --ext .js,.ts,.vue ./src",
40
- "lint:fix": "pnpm lint --fix"
37
+ "build": "pnpm nuke:dist && vue-tsc && vite build",
38
+ "lint": "eslint ./src",
39
+ "lint:fix": "pnpm lint --fix",
40
+ "nuke": "pnpm dlx del-cli dist node_modules",
41
+ "nuke:dist": "pnpm dlx del-cli dist",
42
+ "prepublish": "pnpm build"
41
43
  }
42
44
  }