@figurosity/consumer-pose-generator 0.1.2 → 0.1.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.
@@ -1,8 +1,8 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".pg-overview-content h1{color:#fff;text-align:left;margin:0 0 15px}.pg-overview-content .text-subheading{text-align:left;color:#fff;font-size:20px;font-weight:600}@media(max-width:1023.98px){.pg-overview-content{background:url(https://static.figurosity.com/pose-generator/temp/pose-27.webp) center/contain no-repeat,radial-gradient(147.55% 89.72% at 66.15% 11.38%,#c86dd7,#3023ae);height:100%;padding:20px}.pg-overview-content h1,.pg-overview-content .text-subheading{text-align:center!important}}.pg-exit-button{overflow:hidden}.pg-overview-buttons{z-index:111;position:fixed;bottom:0;left:0;right:0;border-top:1px solid #cccccc}.pg-overview-buttons .pg-animated-count{text-align:center}@media(min-width:768px){.pg-overview-buttons .pg-animated-count{text-align:right}}.pg-card{z-index:9}.pg-card .q-card{background-color:#ffffffd9;border-color:#fff;border-width:1px;border-radius:14px}.pg-card .q-item__section--avatar{min-width:40px}.pg-card-label{font-size:18px;font-weight:900}.pg-card-caption{font-size:14px;font-weight:500;color:#676767}.pg-cards{color:#170a27;z-index:9}.pg-base-button.q-btn{color:#000c;background-color:#ffffff80!important}.pg-base-button.q-btn--outline:before{border-color:#000000b3}.pg-base-button.q-btn .q-icon{font-size:32px}.pg-controls{width:380px}.pg-controls .q-btn--outline:before{border-width:4px}.pg-play-button{position:relative}.pg-play-button.pg-base-button.q-btn .q-icon{font-size:26px;padding:7px 5px 5px;margin-bottom:3px}.pg-play-button .pg-timer-progress{position:absolute;top:0;left:0;z-index:2}.pg-timer-seconds{color:#000c;font-weight:900;font-size:30px;text-align:right;transition:all .3s ease;line-height:40px}.pg-timer-seconds.flash{color:#0087ff}.pg-expansions{background-color:#fff}.pg-expansions .q-separator{margin:0 10px}.pg-durations-tool .q-slider__selection{display:none}.pg-durations-tool-title{font-weight:900;color:#626262!important}.pg-durations-tool .q-slider__marker-labels{font-weight:900;color:#626262;transition:color .15s ease}.pg-durations-tool .pg-durations-tool__is-active{color:#0087ff!important}.c-pose-position{width:200px;height:200px;position:relative;margin:0 auto 10px;color:#0087ff;overflow:hidden}.c-pose-position.disabled{opacity:.7}.c-pose-position *{box-sizing:border-box}.c-pose-position .quickpose-angle{position:absolute;top:0;left:0;z-index:100;border-radius:100px}.c-pose-position .quickpose-angle img{width:96%;height:auto;border-radius:100px}.quarters{transform:rotate(45deg);width:96%;height:96%;position:absolute;top:1px;left:1px;z-index:90;border-radius:100px;overflow:hidden}.quarters.overlay{z-index:110}.quarters.borders .quarter{transition:background-color .3s;border:1px solid #0087ff;background-color:#fff;border-color:#0087ff}.quarters.borders .quarter>span{position:absolute;font-size:13px;left:50%;top:50%;transform:translate(-50%) translateY(-50%) rotate(-45deg)}.quarters.borders .quarter.hover{border-color:#0087ff}.quarters.borders .quarter.active{color:#fff!important;outline:0;border-color:#fff;background-color:#0087ff}.quarters .quarter{border:1px solid transparent;height:49%;width:49%;position:absolute;z-index:110;text-transform:uppercase}.quarters .quarter.active{color:#fff!important}.quarters .quarter.back{top:0;left:0;border-radius:100px 0 0}.quarters .quarter.back.active{border-radius:100px 0 0}.quarters .quarter.left{top:0;right:0;border-radius:0 100px 0 0}.quarters .quarter.left.active{border-radius:0 100px 0 0}.quarters .quarter.front{bottom:0;right:0;border-radius:0 0 100px}.quarters .quarter.front.active{border-radius:0 0 100px}.quarters .quarter.right{bottom:0;left:0;border-radius:0 0 0 100px}.quarters .quarter.right.active{border-radius:0 0 0 100px}.pg-overview{z-index:1;padding-bottom:110px}.pg-display-image{position:absolute;top:50%;left:50%;width:100%;height:auto;-webkit-transform:translateZ(0) translateX(-50%) translateY(-50%) scale3d(1,1,1);transform:translateZ(0) translate(-50%) translateY(-50%) scaleZ(1);z-index:2}.pg-display-image.flip-horizontal{-webkit-transform:translateZ(0) translateX(-50%) translateY(-50%) scale3d(1,1,1) scaleX(-1);transform:translateZ(0) translate(-50%) translateY(-50%) scaleZ(1) scaleX(-1)}.pg-display{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1}.pg-display.negative{background-color:#000!important}.pgfade-enter-from,.pgfade-enter-active,.pgfade-enter-to{z-index:2}.pgfade-leave-from,.pgfade-leave-active,.pgfade-leave-to{z-index:1}.pgfade-enter-active{transition:opacity .25s ease}.pgfade-enter-from{opacity:0}.pgfade-enter-to{opacity:1}.pgfade-leave-active{transition:none}.pg-interaction-detector{position:fixed;top:0;right:0;bottom:0;left:0;z-index:6}.pg-viewport{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2100;background-color:#fffffffc;transition:background-color .25s ease}.pg-viewport .loading-graphic{position:absolute;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.pg-viewport h1{position:fixed;line-height:100%;top:0;right:0;bottom:0;left:0;z-index:400;color:#000}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { ref as j, computed as y, watch as Ne, onBeforeMount as Co, defineComponent as T, h, openBlock as O, createBlock as _t, unref as A, createElementBlock as $, Fragment as Xe, renderList as Ze, createVNode as B, normalizeClass as mt, createElementVNode as De, toDisplayString as _o, onMounted as bt, onBeforeUnmount as es, Transition as qt, withDirectives as vt, vShow as yt, normalizeStyle as on, TransitionGroup as bo, withCtx as jt, inject as Io } from "vue";
2
+ import { ref as j, computed as y, watch as Ne, onBeforeMount as Co, defineComponent as T, h, openBlock as O, createBlock as _t, unref as A, createElementBlock as $, Fragment as Xe, renderList as Ze, createVNode as B, normalizeClass as mt, createElementVNode as De, toDisplayString as _o, onMounted as bt, onBeforeUnmount as Jt, Transition as qt, withDirectives as vt, vShow as yt, normalizeStyle as on, TransitionGroup as bo, withCtx as jt, inject as Io } from "vue";
3
3
  import { useRoute as Po } from "vue-router";
4
4
  import { defineStore as ie, getActivePinia as xo, storeToRefs as S } from "pinia";
5
- import { useDynamicImages as wo, DEFAULT as Me, SKINS as Gt, DURATION as Yt, NOTHING as Do, EFFECTS as St, CAMERA_ANGLE as xs, LIGHT_DIRECTION as ws, GENDER as Tt, GRID as Ds, POSE_DIRECTION as Ms, ADJUSTMENTS as As, slugify as Mo, useEventBus as rn, useFilterStyle as Ao, FlipAnimation as No, useWakeLock as Oo } from "@figurosity/toolbox";
5
+ import { getConfig as es, useDynamicImages as wo, DEFAULT as Me, SKINS as Gt, DURATION as Yt, NOTHING as Do, EFFECTS as St, CAMERA_ANGLE as xs, LIGHT_DIRECTION as ws, GENDER as Tt, GRID as Ds, POSE_DIRECTION as Ms, ADJUSTMENTS as As, slugify as Mo, useEventBus as rn, useFilterStyle as Ao, FlipAnimation as No, useWakeLock as Oo } from "@figurosity/toolbox";
6
6
  import an from "lodash-es/debounce";
7
7
  import { useQuasar as It, QSlider as ko, QSeparator as J, QCard as Lo, QItem as Vo, QItemSection as Ns, QIcon as Uo, QItemLabel as Os, QCardSection as Ro, QBtn as Oe, QPageSticky as Bo, QCircularProgress as $o } from "quasar";
8
8
  import { CExpansion as me, CBaseButton as Qe, CBaseButtons as ln, CNewGridTool as zo, CBasicTool as ts, CAnimatedNumber as Ho, CGridOverlay as Fo, CFloatingModal as qo, CDraggableDrawer as cn, CDraggableDrawers as jo } from "@figurosity/consumer-controls";
@@ -124,8 +124,9 @@ const nr = {}, or = {
124
124
  src(e) {
125
125
  return (t) => {
126
126
  const s = this.propertyById(t, "slug");
127
- if (s)
128
- return `${this.staticServer}/pose-generator/camera-angles/camera-${s}.webp`;
127
+ if (!s) return;
128
+ const { staticServer: n } = es();
129
+ return `${n}/pose-generator/camera-angles/camera-${s}.webp`;
129
130
  };
130
131
  },
131
132
  caption(e) {
@@ -255,15 +256,9 @@ const Z = ie("pg-durations", {
255
256
  }
256
257
  }
257
258
  });
258
- let Wt = {};
259
- function Ca(e) {
260
- Wt = e;
261
- }
262
259
  function Ke() {
263
- return wo({
264
- freeServer: Wt.freeServer,
265
- paidServer: Wt.paidServer
266
- });
260
+ const { freeServer: e, paidServer: t } = es();
261
+ return wo({ freeServer: e, paidServer: t });
267
262
  }
268
263
  const ar = {
269
264
  uuid: void 0,
@@ -451,8 +446,9 @@ const ar = {
451
446
  src(e) {
452
447
  return (t) => {
453
448
  const s = this.propertyById(t, "slug");
454
- if (s)
455
- return `${this.staticServer}/pose-generator/light-direction/from-${s}.webp`;
449
+ if (!s) return;
450
+ const { staticServer: n } = es();
451
+ return `${n}/pose-generator/light-direction/from-${s}.webp`;
456
452
  };
457
453
  },
458
454
  caption(e) {
@@ -1062,7 +1058,7 @@ const Pt = ie("pg-count", {
1062
1058
  typeof e == "number" && (this.ttlMs = e), typeof t == "number" && (this.maxEntries = t);
1063
1059
  }
1064
1060
  }
1065
- }), Et = 0, Xt = 1, Ir = 2, gn = 3, Zt = 4, mn = 5, Pr = {
1061
+ }), Et = 0, Wt = 1, Ir = 2, gn = 3, Xt = 4, mn = 5, Pr = {
1066
1062
  /**
1067
1063
  * Load the image and update the status of the
1068
1064
  * @param context
@@ -1072,16 +1068,16 @@ const Pt = ie("pg-count", {
1072
1068
  */
1073
1069
  loadImage({ url: e, callback: t = null }) {
1074
1070
  if (typeof Image > "u")
1075
- throw t && typeof t == "function" && t(e, Xt), new Error("Image() constructor does not exist.");
1071
+ throw t && typeof t == "function" && t(e, Wt), new Error("Image() constructor does not exist.");
1076
1072
  t && typeof t == "function" && t(e, Ir);
1077
1073
  let s = new Image();
1078
1074
  s.onabort = function(n) {
1079
1075
  t && typeof t == "function" && t(e, gn), this.onerror = this.onabort = this.onload = null;
1080
1076
  }, s.onerror = function(n) {
1081
- t && typeof t == "function" && t(e, Xt), this.onerror = this.onabort = this.onload = null;
1077
+ t && typeof t == "function" && t(e, Wt), this.onerror = this.onabort = this.onload = null;
1082
1078
  }, s.onload = function(n) {
1083
1079
  t && typeof t == "function" && t(e, mn), this.onerror = this.onabort = this.onload = null;
1084
- }, s.src = e, t && typeof t == "function" && t(e, Zt);
1080
+ }, s.src = e, t && typeof t == "function" && t(e, Xt);
1085
1081
  }
1086
1082
  };
1087
1083
  function xr(e, t) {
@@ -1279,7 +1275,7 @@ const X = ie("pg-history", {
1279
1275
  if (a == null) return;
1280
1276
  this.models[a] || (this.models[a] = $t(a));
1281
1277
  const c = this.models[a];
1282
- (c.status === Et || c.status === Zt) && this.loadImage({
1278
+ (c.status === Et || c.status === Xt) && this.loadImage({
1283
1279
  url: c.src,
1284
1280
  callback: this.updateStatus
1285
1281
  });
@@ -1322,10 +1318,10 @@ const X = ie("pg-history", {
1322
1318
  for (const s of t) {
1323
1319
  this.models[s] || (this.models[s] = $t(s));
1324
1320
  const n = this.models[s], r = n.status;
1325
- if ((r === Et || r === Zt) && this.loadImage({
1321
+ if ((r === Et || r === Xt) && this.loadImage({
1326
1322
  url: n.src,
1327
1323
  callback: this.updateStatus
1328
- }), r === Xt || r === gn) {
1324
+ }), r === Wt || r === gn) {
1329
1325
  delete this.models[s];
1330
1326
  const a = this.queue.indexOf(s);
1331
1327
  a !== -1 && this.queue.splice(a, 1);
@@ -2667,7 +2663,7 @@ const X = ie("pg-history", {
2667
2663
  width: window.innerWidth,
2668
2664
  height: window.innerHeight
2669
2665
  }), g.value = { width: n.screen.width, height: n.screen.height };
2670
- }), es(() => r.$off("resize"));
2666
+ }), Jt(() => r.$off("resize"));
2671
2667
  function P() {
2672
2668
  const I = {
2673
2669
  class: "pg-grid-overlay",
@@ -2980,7 +2976,7 @@ const X = ie("pg-history", {
2980
2976
  }
2981
2977
  return bt(() => {
2982
2978
  u(), s.$on("resize", d);
2983
- }), es(() => s.$off("resize")), (f, g) => (O(), $("img", {
2979
+ }), Jt(() => s.$off("resize")), (f, g) => (O(), $("img", {
2984
2980
  src: r.value,
2985
2981
  class: mt(["pg-display-image", { "flip-horizontal": e.flipped }]),
2986
2982
  style: on(c.value)
@@ -4214,10 +4210,10 @@ function xi() {
4214
4210
  var xt = xi();
4215
4211
  const oe = /* @__PURE__ */ tr({
4216
4212
  __proto__: null
4217
- }, [xt]), Rn = 1, Bn = 2, Qt = 4, wi = {
4213
+ }, [xt]), Rn = 1, Bn = 2, Zt = 4, wi = {
4218
4214
  mousedown: Rn,
4219
4215
  mousemove: Bn,
4220
- mouseup: Qt
4216
+ mouseup: Zt
4221
4217
  };
4222
4218
  function Di(e, t) {
4223
4219
  for (let s = 0; s < e.length; s++)
@@ -4235,7 +4231,7 @@ function Mi(e) {
4235
4231
  function Ai(e) {
4236
4232
  e.prototype.handler = function(s) {
4237
4233
  let n = wi[s.type];
4238
- n & Rn && s.button >= 0 && (this.pressed = !0), n & Bn && s.buttons === 0 && (n = Qt), this.pressed && (n & Qt && (this.pressed = !1), this.callback(this.manager, n, {
4234
+ n & Rn && s.button >= 0 && (this.pressed = !0), n & Bn && s.buttons === 0 && (n = Zt), this.pressed && (n & Zt && (this.pressed = !1), this.callback(this.manager, n, {
4239
4235
  pointers: [s],
4240
4236
  changedPointers: [s],
4241
4237
  pointerType: "mouse",
@@ -4341,18 +4337,18 @@ const Oi = oe ? [
4341
4337
  mouseout: "pointerout",
4342
4338
  mouseleave: "pointerleave"
4343
4339
  }, Ui = typeof navigator < "u" && navigator.userAgent ? navigator.userAgent.toLowerCase() : "", Ae = typeof window < "u" ? window : global;
4344
- let Kt = !1;
4340
+ let Qt = !1;
4345
4341
  try {
4346
4342
  const e = {
4347
4343
  // This function will be called when the browser
4348
4344
  // attempts to access the passive property.
4349
4345
  get passive() {
4350
- return Kt = !0, !0;
4346
+ return Qt = !0, !0;
4351
4347
  }
4352
4348
  };
4353
4349
  Ae.addEventListener("test", null, e), Ae.removeEventListener("test", null);
4354
4350
  } catch {
4355
- Kt = !1;
4351
+ Qt = !1;
4356
4352
  }
4357
4353
  const Ri = Ui.indexOf("firefox") !== -1, { WHEEL_EVENTS: Bi } = os, Gs = "wheel", Ys = 4.000244140625, $i = 40, zi = 0.25;
4358
4354
  class Hi extends wt {
@@ -4372,7 +4368,7 @@ class Hi extends wt {
4372
4368
  pointerType: "mouse",
4373
4369
  target: r.target
4374
4370
  });
4375
- }, this.events = (this.options.events || []).concat(Bi), this.events.forEach((r) => t.addEventListener(r, this.handleEvent, Kt ? { passive: !1 } : !1));
4371
+ }, this.events = (this.options.events || []).concat(Bi), this.events.forEach((r) => t.addEventListener(r, this.handleEvent, Qt ? { passive: !1 } : !1));
4376
4372
  }
4377
4373
  destroy() {
4378
4374
  this.events.forEach((t) => this.element.removeEventListener(t, this.handleEvent));
@@ -4499,12 +4495,12 @@ class Yi extends wt {
4499
4495
  t === tn && (this.options.enable = s);
4500
4496
  }
4501
4497
  }
4502
- const sn = 1, Jt = 2, nn = 4, Wi = {
4498
+ const sn = 1, Kt = 2, nn = 4, Wi = {
4503
4499
  pointerdown: sn,
4504
- pointermove: Jt,
4500
+ pointermove: Kt,
4505
4501
  pointerup: nn,
4506
4502
  mousedown: sn,
4507
- mousemove: Jt,
4503
+ mousemove: Kt,
4508
4504
  mouseup: nn
4509
4505
  }, Xi = 0, Zi = 1, Qi = 2, Ki = 1, Ji = 2, ea = 4;
4510
4506
  function ta(e) {
@@ -4513,7 +4509,7 @@ function ta(e) {
4513
4509
  return null;
4514
4510
  const { buttons: s, button: n } = e.srcEvent;
4515
4511
  let r = !1, a = !1, c = !1;
4516
- return t === Jt ? (r = !!(s & Ki), a = !!(s & ea), c = !!(s & Ji)) : (r = n === Xi, a = n === Zi, c = n === Qi), { leftButton: r, middleButton: a, rightButton: c };
4512
+ return t === Kt ? (r = !!(s & Ki), a = !!(s & ea), c = !!(s & Ji)) : (r = n === Xi, a = n === Zi, c = n === Qi), { leftButton: r, middleButton: a, rightButton: c };
4517
4513
  }
4518
4514
  function sa(e, t) {
4519
4515
  const s = e.center;
@@ -4823,7 +4819,7 @@ const ia = {
4823
4819
  tap: C
4824
4820
  // pointerdown: togglePlay,
4825
4821
  });
4826
- }), es(() => {
4822
+ }), Jt(() => {
4827
4823
  d && d.destroy();
4828
4824
  }), (b, x) => (O(), $("div", {
4829
4825
  class: "pg-interaction-detector",
@@ -4964,7 +4960,7 @@ const ia = {
4964
4960
  _: 1
4965
4961
  }));
4966
4962
  }
4967
- }, _a = T({
4963
+ }, Ca = T({
4968
4964
  name: "PoseGenerator",
4969
4965
  options: { slug: "pose-generator" },
4970
4966
  setup(e, { slots: t, emit: s }) {
@@ -5002,7 +4998,6 @@ const ia = {
5002
4998
  }
5003
4999
  });
5004
5000
  export {
5005
- _a as PoseGenerator,
5006
- Ca as setImageServers,
5001
+ Ca as PoseGenerator,
5007
5002
  k as usePgStore
5008
5003
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@figurosity/consumer-pose-generator",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Timed figure-drawing pose generator for the Figurosity consumer frontend",
5
5
  "type": "module",
6
6
  "main": "./dist/consumer-pose-generator.js",