|
1 | 1 | /*! licenses: /vendor.LICENSE.txt */
|
2 |
| -import { defineComponent, h, openBlock, createElementBlock, resolveComponent, createElementVNode, createVNode, withCtx, createApp } from "vue"; |
| 2 | +import { defineComponent, h } from "vue"; |
3 | 3 | const version = "3.7.3";
|
4 | 4 | const VERSION$2 = version;
|
5 | 5 | const _hasatob = typeof atob === "function";
|
@@ -940,7 +940,7 @@ const IxImg = defineComponent({
|
940 | 940 | });
|
941 | 941 | }
|
942 | 942 | });
|
943 |
| -const VERSION = "3.0.4"; |
| 943 | +const VERSION = "3.1.0-rc.1"; |
944 | 944 | const clientOptionDefaults = {
|
945 | 945 | includeLibraryParam: true
|
946 | 946 | };
|
@@ -1008,6 +1008,12 @@ class VueImgixClient {
|
1008 | 1008 | }
|
1009 | 1009 | }
|
1010 | 1010 | }
|
| 1011 | +const buildImgixClient = (options) => { |
| 1012 | + const client = new VueImgixClient({ |
| 1013 | + ...options |
| 1014 | + }); |
| 1015 | + return client; |
| 1016 | +}; |
1011 | 1017 | let vueImgixClientSingleton = void 0;
|
1012 | 1018 | const initVueImgix = (options) => {
|
1013 | 1019 | vueImgixClientSingleton = new VueImgixClient(options);
|
@@ -1088,220 +1094,4 @@ install.installed = false;
|
1088 | 1094 | const plugin = {
|
1089 | 1095 | install
|
1090 | 1096 | };
|
1091 |
| -var _export_sfc = (sfc, props) => { |
1092 |
| - const target = sfc.__vccOpts || sfc; |
1093 |
| - for (const [key, val] of props) { |
1094 |
| - target[key] = val; |
1095 |
| - } |
1096 |
| - return target; |
1097 |
| -}; |
1098 |
| -const _sfc_main$7 = { |
1099 |
| - name: "advanced-build-url-object", |
1100 |
| - computed: { |
1101 |
| - advancedSrcObject: () => buildUrlObject("examples/pione.jpg", { |
1102 |
| - auto: "format" |
1103 |
| - }) |
1104 |
| - } |
1105 |
| -}; |
1106 |
| -const _hoisted_1$7 = ["src", "srcset"]; |
1107 |
| -function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { |
1108 |
| - return openBlock(), createElementBlock("img", { |
1109 |
| - src: $options.advancedSrcObject.src, |
1110 |
| - srcset: $options.advancedSrcObject.srcset, |
1111 |
| - sizes: "50vw", |
1112 |
| - "data-testid": "advanced-basic-image" |
1113 |
| - }, null, 8, _hoisted_1$7); |
1114 |
| -} |
1115 |
| -var advancedBuildUrlObject = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]); |
1116 |
| -const _sfc_main$6 = { |
1117 |
| - name: "advanced-build-url", |
1118 |
| - computed: { |
1119 |
| - advancedUrl: () => buildUrl("examples/pione.jpg", { |
1120 |
| - auto: "format", |
1121 |
| - w: 400 |
1122 |
| - }) |
1123 |
| - } |
1124 |
| -}; |
1125 |
| -const _hoisted_1$6 = ["src"]; |
1126 |
| -function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { |
1127 |
| - return openBlock(), createElementBlock("img", { |
1128 |
| - src: $options.advancedUrl, |
1129 |
| - "data-testid": "advanced-build-url" |
1130 |
| - }, null, 8, _hoisted_1$6); |
1131 |
| -} |
1132 |
| -var advancedBuildUrl = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]); |
1133 |
| -const _sfc_main$5 = { |
1134 |
| - name: "advanced-build-srcset", |
1135 |
| - computed: { |
1136 |
| - advancedSrc: () => buildUrl("examples/pione.jpg", { |
1137 |
| - auto: "format" |
1138 |
| - }), |
1139 |
| - advancedSrcSet: () => buildSrcSet("examples/pione.jpg", { |
1140 |
| - auto: "format" |
1141 |
| - }) |
1142 |
| - } |
1143 |
| -}; |
1144 |
| -const _hoisted_1$5 = ["src", "srcset"]; |
1145 |
| -function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { |
1146 |
| - return openBlock(), createElementBlock("img", { |
1147 |
| - src: $options.advancedSrc, |
1148 |
| - srcset: $options.advancedSrcSet, |
1149 |
| - "data-testid": "advanced-build-src-set" |
1150 |
| - }, null, 8, _hoisted_1$5); |
1151 |
| -} |
1152 |
| -var advancedBuildSrcSet = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]); |
1153 |
| -const _sfc_main$4 = { |
1154 |
| - name: "static-build-src-set", |
1155 |
| - computed: { |
1156 |
| - advancedSrc: () => buildUrl("https://sdk-test.imgix.net/amsterdam.jpg", { |
1157 |
| - auto: "format" |
1158 |
| - }), |
1159 |
| - advancedSrcSet: () => buildSrcSet("https://sdk-test.imgix.net/amsterdam.jpg", { |
1160 |
| - auto: "format" |
1161 |
| - }) |
1162 |
| - } |
1163 |
| -}; |
1164 |
| -const _hoisted_1$4 = ["src", "srcset"]; |
1165 |
| -function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { |
1166 |
| - return openBlock(), createElementBlock("img", { |
1167 |
| - src: $options.advancedSrc, |
1168 |
| - srcset: $options.advancedSrcSet, |
1169 |
| - "data-testid": "static-build-src-set" |
1170 |
| - }, null, 8, _hoisted_1$4); |
1171 |
| -} |
1172 |
| -var staticBuildSrcSet = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]); |
1173 |
| -const _sfc_main$3 = { |
1174 |
| - name: "advance-api" |
1175 |
| -}; |
1176 |
| -const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("h2", null, "attributeConfig", -1); |
1177 |
| -const _hoisted_2$2 = { "data-testid": "advanced-attribute-config" }; |
1178 |
| -function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { |
1179 |
| - const _component_ix_img = resolveComponent("ix-img"); |
1180 |
| - return openBlock(), createElementBlock("div", null, [ |
1181 |
| - _hoisted_1$3, |
1182 |
| - createElementVNode("div", _hoisted_2$2, [ |
1183 |
| - createVNode(_component_ix_img, { |
1184 |
| - src: "examples/pione.jpg", |
1185 |
| - attributeConfig: { |
1186 |
| - src: "data-src", |
1187 |
| - srcset: "data-srcset" |
1188 |
| - } |
1189 |
| - }) |
1190 |
| - ]) |
1191 |
| - ]); |
1192 |
| -} |
1193 |
| -var advancedApi = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]); |
1194 |
| -const _sfc_main$2 = { |
1195 |
| - name: "simple-api" |
1196 |
| -}; |
1197 |
| -const _hoisted_1$2 = /* @__PURE__ */ createElementVNode("h2", null, "Simple", -1); |
1198 |
| -const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("h2", null, "Fixed", -1); |
1199 |
| -const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("h2", null, "Picture", -1); |
1200 |
| -const _hoisted_4$1 = { "data-testid": "simple-picture" }; |
1201 |
| -function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { |
1202 |
| - const _component_ix_img = resolveComponent("ix-img"); |
1203 |
| - const _component_ix_source = resolveComponent("ix-source"); |
1204 |
| - const _component_ix_picture = resolveComponent("ix-picture"); |
1205 |
| - return openBlock(), createElementBlock("div", null, [ |
1206 |
| - _hoisted_1$2, |
1207 |
| - createVNode(_component_ix_img, { |
1208 |
| - src: "examples/pione.jpg", |
1209 |
| - sizes: "20vw", |
1210 |
| - "data-testid": "simple-fluid" |
1211 |
| - }), |
1212 |
| - _hoisted_2$1, |
1213 |
| - createVNode(_component_ix_img, { |
1214 |
| - src: "examples/pione.jpg", |
1215 |
| - width: "100", |
1216 |
| - fixed: "", |
1217 |
| - "data-testid": "simple-fixed-width" |
1218 |
| - }), |
1219 |
| - _hoisted_3$1, |
1220 |
| - createElementVNode("div", _hoisted_4$1, [ |
1221 |
| - createVNode(_component_ix_picture, null, { |
1222 |
| - default: withCtx(() => [ |
1223 |
| - createVNode(_component_ix_source, { src: "blog/unsplash-kiss.jpg" }), |
1224 |
| - createVNode(_component_ix_img, { src: "blog/unsplash-kiss.jpg" }) |
1225 |
| - ]), |
1226 |
| - _: 1 |
1227 |
| - }) |
1228 |
| - ]) |
1229 |
| - ]); |
1230 |
| -} |
1231 |
| -var simple = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); |
1232 |
| -const _sfc_main$1 = { |
1233 |
| - name: "static-api" |
1234 |
| -}; |
1235 |
| -const _hoisted_1$1 = /* @__PURE__ */ createElementVNode("h2", null, "Absolute URL Static API Example", -1); |
1236 |
| -function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { |
1237 |
| - const _component_ix_img = resolveComponent("ix-img"); |
1238 |
| - return openBlock(), createElementBlock("div", null, [ |
1239 |
| - _hoisted_1$1, |
1240 |
| - createVNode(_component_ix_img, { |
1241 |
| - src: "/examples/pione.jpg", |
1242 |
| - width: "100", |
1243 |
| - "data-testid": "static-api-relative" |
1244 |
| - }), |
1245 |
| - createVNode(_component_ix_img, { |
1246 |
| - src: "https://sdk-test.imgix.net/amsterdam.jpg", |
1247 |
| - width: "100", |
1248 |
| - "data-testid": "static-api-absolute" |
1249 |
| - }) |
1250 |
| - ]); |
1251 |
| -} |
1252 |
| -var staticApi = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]); |
1253 |
| -const _sfc_main = { |
1254 |
| - name: "App", |
1255 |
| - components: { |
1256 |
| - advancedBuildUrlObject, |
1257 |
| - advancedBuildUrl, |
1258 |
| - advancedBuildSrcSet, |
1259 |
| - staticBuildSrcSet, |
1260 |
| - advancedApi, |
1261 |
| - simple, |
1262 |
| - staticApi |
1263 |
| - }, |
1264 |
| - computed: {} |
1265 |
| -}; |
1266 |
| -const _hoisted_1 = { id: "app" }; |
1267 |
| -const _hoisted_2 = /* @__PURE__ */ createElementVNode("h1", null, "Simple Usage", -1); |
1268 |
| -const _hoisted_3 = /* @__PURE__ */ createElementVNode("h1", null, "Static Usage", -1); |
1269 |
| -const _hoisted_4 = /* @__PURE__ */ createElementVNode("h1", null, "Advanced Usage", -1); |
1270 |
| -const _hoisted_5 = /* @__PURE__ */ createElementVNode("h2", null, "buildUrlObject", -1); |
1271 |
| -const _hoisted_6 = /* @__PURE__ */ createElementVNode("h2", null, "buildUrl", -1); |
1272 |
| -const _hoisted_7 = /* @__PURE__ */ createElementVNode("h2", null, "buildSrcSet", -1); |
1273 |
| -const _hoisted_8 = /* @__PURE__ */ createElementVNode("h2", null, "_buildSrcSet", -1); |
1274 |
| -function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { |
1275 |
| - const _component_simple = resolveComponent("simple"); |
1276 |
| - const _component_static_api = resolveComponent("static-api"); |
1277 |
| - const _component_advanced_api = resolveComponent("advanced-api"); |
1278 |
| - const _component_advanced_build_url_object = resolveComponent("advanced-build-url-object"); |
1279 |
| - const _component_advanced_build_url = resolveComponent("advanced-build-url"); |
1280 |
| - const _component_advanced_build_src_set = resolveComponent("advanced-build-src-set"); |
1281 |
| - const _component_static_build_src_set = resolveComponent("static-build-src-set"); |
1282 |
| - return openBlock(), createElementBlock("div", _hoisted_1, [ |
1283 |
| - _hoisted_2, |
1284 |
| - createVNode(_component_simple), |
1285 |
| - _hoisted_3, |
1286 |
| - createVNode(_component_static_api), |
1287 |
| - _hoisted_4, |
1288 |
| - createVNode(_component_advanced_api), |
1289 |
| - _hoisted_5, |
1290 |
| - createVNode(_component_advanced_build_url_object), |
1291 |
| - _hoisted_6, |
1292 |
| - createVNode(_component_advanced_build_url), |
1293 |
| - _hoisted_7, |
1294 |
| - createVNode(_component_advanced_build_src_set), |
1295 |
| - _hoisted_8, |
1296 |
| - createVNode(_component_static_build_src_set) |
1297 |
| - ]); |
1298 |
| -} |
1299 |
| -var App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); |
1300 |
| -const app = createApp(App); |
1301 |
| -app.use(plugin, { |
1302 |
| - domain: "assets.imgix.net", |
1303 |
| - defaultIxParams: { |
1304 |
| - auto: "format" |
1305 |
| - } |
1306 |
| -}).mount("#app"); |
1307 |
| -export { app }; |
| 1097 | +export { IxImg, buildImgixClient, buildSrcSet, buildUrl, buildUrlObject, plugin as default, ensureVueImgixClientSingleton, initVueImgix, install }; |
0 commit comments