lookbook 1.1.1 → 1.2.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.
- checksums.yaml +4 -4
- data/app/assets/lookbook/js/helpers/string.js +23 -1
- data/app/assets/lookbook/js/lookbook.js +0 -1
- data/app/components/lookbook/display_options/editor/component.html.erb +13 -0
- data/app/components/lookbook/display_options/editor/component.rb +7 -0
- data/app/components/lookbook/display_options/field/component.css +33 -0
- data/app/components/lookbook/display_options/field/component.html.erb +8 -0
- data/app/components/lookbook/display_options/field/component.js +30 -0
- data/app/components/lookbook/display_options/field/component.rb +28 -0
- data/app/components/lookbook/inspector_panel/component.html.erb +1 -1
- data/app/components/lookbook/inspector_panel/component.rb +10 -11
- data/app/components/lookbook/params/editor/component.rb +6 -3
- data/app/components/lookbook/params/field/component.rb +1 -5
- data/app/components/lookbook/tab_panels/panel/component.html.erb +1 -1
- data/app/components/lookbook/tab_panels/panel/component.rb +1 -2
- data/app/components/lookbook/tabs/dropdown_tab/component.html.erb +1 -0
- data/app/components/lookbook/tabs/tab/component.html.erb +1 -0
- data/app/components/lookbook/viewport/component.html.erb +1 -1
- data/app/components/lookbook/viewport/component.rb +2 -1
- data/app/controllers/lookbook/previews_controller.rb +40 -29
- data/app/helpers/lookbook/preview_helper.rb +1 -1
- data/app/views/lookbook/previews/panels/_params.html.erb +1 -1
- data/app/views/lookbook/previews/panels/_preview.html.erb +9 -6
- data/app/views/lookbook/previews/show.html.erb +29 -11
- data/config/app.yml +36 -0
- data/config/hooks.yml +4 -0
- data/config/inputs.yml +48 -0
- data/config/panels.yml +30 -0
- data/config/routes.rb +1 -1
- data/config/tags.yml +29 -0
- data/lib/lookbook/engine.rb +40 -20
- data/lib/lookbook/markdown.rb +1 -11
- data/lib/lookbook/page.rb +1 -1
- data/lib/lookbook/params.rb +0 -7
- data/lib/lookbook/parser.rb +3 -10
- data/lib/lookbook/preview.rb +7 -3
- data/lib/lookbook/preview_example.rb +7 -3
- data/lib/lookbook/preview_group.rb +2 -2
- data/lib/lookbook/services/config_loader.rb +20 -0
- data/lib/lookbook/services/search_param_builder.rb +13 -0
- data/lib/lookbook/services/search_param_parser.rb +15 -0
- data/lib/lookbook/services/tags/key_value_tag_parser.rb +24 -0
- data/lib/lookbook/source_inspector.rb +10 -16
- data/lib/lookbook/stores/config_store.rb +80 -0
- data/lib/lookbook/stores/hook_store.rb +28 -0
- data/lib/lookbook/stores/input_store.rb +58 -0
- data/lib/lookbook/stores/panel_store.rb +141 -0
- data/lib/lookbook/stores/tag_store.rb +46 -0
- data/lib/lookbook/support/errors/config_error.rb +7 -0
- data/lib/lookbook/support/errors/lookbook_error.rb +21 -0
- data/lib/lookbook/support/errors/parser_error.rb +7 -0
- data/lib/lookbook/support/service.rb +7 -0
- data/lib/lookbook/support/store.rb +77 -0
- data/lib/lookbook/support/utils/attribute_utils.rb +9 -0
- data/lib/lookbook/support/utils/path_utils.rb +19 -0
- data/lib/lookbook/tags.rb +5 -14
- data/lib/lookbook/version.rb +1 -1
- data/lib/lookbook.rb +43 -12
- data/public/lookbook-assets/css/lookbook.css +33 -0
- data/public/lookbook-assets/css/lookbook.css.map +1 -1
- data/public/lookbook-assets/js/lookbook.js +137 -4
- data/public/lookbook-assets/js/lookbook.js.map +1 -1
- metadata +29 -6
- data/lib/lookbook/config.rb +0 -278
- data/lib/lookbook/hooks.rb +0 -21
- data/lib/lookbook/panels.rb +0 -25
- data/lib/lookbook/store.rb +0 -34
|
@@ -6830,6 +6830,19 @@ function $7ae6ae39c2ec9059$export$6cb344a21ca18aec(content) {
|
|
|
6830
6830
|
function $7ae6ae39c2ec9059$export$2ce3c33e50a76e49(string, prefix = null) {
|
|
6831
6831
|
return prefix ? `${prefix}-${string}` : string;
|
|
6832
6832
|
}
|
|
6833
|
+
function $7ae6ae39c2ec9059$export$f720fd0ddbeb53d9(value) {
|
|
6834
|
+
const params = {};
|
|
6835
|
+
value.split("|").forEach((pair_str)=>{
|
|
6836
|
+
const [key, value] = pair_str.split(":").map((part)=>part.trim());
|
|
6837
|
+
params[key] = value;
|
|
6838
|
+
});
|
|
6839
|
+
return params;
|
|
6840
|
+
}
|
|
6841
|
+
function $7ae6ae39c2ec9059$export$c788aab010beeaec(data) {
|
|
6842
|
+
const pairs = [];
|
|
6843
|
+
for (const [key, value] of Object.entries(data))pairs.push(`${key}:${value}`);
|
|
6844
|
+
return pairs.join("|");
|
|
6845
|
+
}
|
|
6833
6846
|
|
|
6834
6847
|
|
|
6835
6848
|
const { sidebar: $aabd7bdddb195dac$var$sidebar , main: $aabd7bdddb195dac$var$main , inspector: $aabd7bdddb195dac$var$inspector } = (0, $4d527fa4ac70acba$export$2e2bcd8739ae039);
|
|
@@ -13346,7 +13359,125 @@ $1f889267678ff167$exports = {
|
|
|
13346
13359
|
};
|
|
13347
13360
|
|
|
13348
13361
|
|
|
13349
|
-
var $
|
|
13362
|
+
var $fe98e3f2bf49b28f$exports = {};
|
|
13363
|
+
var $6a9b69d9cc7f810f$exports = {};
|
|
13364
|
+
|
|
13365
|
+
$parcel$defineInteropFlag($6a9b69d9cc7f810f$exports);
|
|
13366
|
+
|
|
13367
|
+
$parcel$export($6a9b69d9cc7f810f$exports, "default", () => $6a9b69d9cc7f810f$export$2e2bcd8739ae039);
|
|
13368
|
+
var $cdfeaa1e0e8d642c$exports = {};
|
|
13369
|
+
(function(global, factory) {
|
|
13370
|
+
$cdfeaa1e0e8d642c$exports = factory();
|
|
13371
|
+
})($cdfeaa1e0e8d642c$exports, function() {
|
|
13372
|
+
"use strict";
|
|
13373
|
+
/* eslint-disable no-var */ function assign(target) {
|
|
13374
|
+
for(var i = 1; i < arguments.length; i++){
|
|
13375
|
+
var source = arguments[i];
|
|
13376
|
+
for(var key in source)target[key] = source[key];
|
|
13377
|
+
}
|
|
13378
|
+
return target;
|
|
13379
|
+
}
|
|
13380
|
+
/* eslint-enable no-var */ /* eslint-disable no-var */ var defaultConverter = {
|
|
13381
|
+
read: function(value) {
|
|
13382
|
+
if (value[0] === '"') value = value.slice(1, -1);
|
|
13383
|
+
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
13384
|
+
},
|
|
13385
|
+
write: function(value) {
|
|
13386
|
+
return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
|
|
13387
|
+
}
|
|
13388
|
+
};
|
|
13389
|
+
/* eslint-enable no-var */ /* eslint-disable no-var */ function init(converter, defaultAttributes) {
|
|
13390
|
+
function set(key, value, attributes) {
|
|
13391
|
+
if (typeof document === "undefined") return;
|
|
13392
|
+
attributes = assign({}, defaultAttributes, attributes);
|
|
13393
|
+
if (typeof attributes.expires === "number") attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
13394
|
+
if (attributes.expires) attributes.expires = attributes.expires.toUTCString();
|
|
13395
|
+
key = encodeURIComponent(key).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
13396
|
+
var stringifiedAttributes = "";
|
|
13397
|
+
for(var attributeName in attributes){
|
|
13398
|
+
if (!attributes[attributeName]) continue;
|
|
13399
|
+
stringifiedAttributes += "; " + attributeName;
|
|
13400
|
+
if (attributes[attributeName] === true) continue;
|
|
13401
|
+
// Considers RFC 6265 section 5.2:
|
|
13402
|
+
// ...
|
|
13403
|
+
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
|
13404
|
+
// character:
|
|
13405
|
+
// Consume the characters of the unparsed-attributes up to,
|
|
13406
|
+
// not including, the first %x3B (";") character.
|
|
13407
|
+
// ...
|
|
13408
|
+
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
13409
|
+
}
|
|
13410
|
+
return document.cookie = key + "=" + converter.write(value, key) + stringifiedAttributes;
|
|
13411
|
+
}
|
|
13412
|
+
function get(key) {
|
|
13413
|
+
if (typeof document === "undefined" || arguments.length && !key) return;
|
|
13414
|
+
// To prevent the for loop in the first place assign an empty array
|
|
13415
|
+
// in case there are no cookies at all.
|
|
13416
|
+
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
13417
|
+
var jar = {};
|
|
13418
|
+
for(var i = 0; i < cookies.length; i++){
|
|
13419
|
+
var parts = cookies[i].split("=");
|
|
13420
|
+
var value = parts.slice(1).join("=");
|
|
13421
|
+
try {
|
|
13422
|
+
var foundKey = decodeURIComponent(parts[0]);
|
|
13423
|
+
jar[foundKey] = converter.read(value, foundKey);
|
|
13424
|
+
if (key === foundKey) break;
|
|
13425
|
+
} catch (e) {}
|
|
13426
|
+
}
|
|
13427
|
+
return key ? jar[key] : jar;
|
|
13428
|
+
}
|
|
13429
|
+
return Object.create({
|
|
13430
|
+
set: set,
|
|
13431
|
+
get: get,
|
|
13432
|
+
remove: function(key, attributes) {
|
|
13433
|
+
set(key, "", assign({}, attributes, {
|
|
13434
|
+
expires: -1
|
|
13435
|
+
}));
|
|
13436
|
+
},
|
|
13437
|
+
withAttributes: function(attributes) {
|
|
13438
|
+
return init(this.converter, assign({}, this.attributes, attributes));
|
|
13439
|
+
},
|
|
13440
|
+
withConverter: function(converter) {
|
|
13441
|
+
return init(assign({}, this.converter, converter), this.attributes);
|
|
13442
|
+
}
|
|
13443
|
+
}, {
|
|
13444
|
+
attributes: {
|
|
13445
|
+
value: Object.freeze(defaultAttributes)
|
|
13446
|
+
},
|
|
13447
|
+
converter: {
|
|
13448
|
+
value: Object.freeze(converter)
|
|
13449
|
+
}
|
|
13450
|
+
});
|
|
13451
|
+
}
|
|
13452
|
+
var api = init(defaultConverter, {
|
|
13453
|
+
path: "/"
|
|
13454
|
+
});
|
|
13455
|
+
/* eslint-enable no-var */ return api;
|
|
13456
|
+
});
|
|
13457
|
+
|
|
13458
|
+
|
|
13459
|
+
|
|
13460
|
+
function $6a9b69d9cc7f810f$export$2e2bcd8739ae039({ name: name , value: value }) {
|
|
13461
|
+
return {
|
|
13462
|
+
name: name,
|
|
13463
|
+
value: value,
|
|
13464
|
+
init () {
|
|
13465
|
+
this.$watch("value", ()=>this.update());
|
|
13466
|
+
},
|
|
13467
|
+
update () {
|
|
13468
|
+
(0, (/*@__PURE__*/$parcel$interopDefault($cdfeaa1e0e8d642c$exports))).set(`lookbook-display-${name}`, this.value);
|
|
13469
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
13470
|
+
const display = searchParams.get("_display");
|
|
13471
|
+
const displayParams = display ? (0, $7ae6ae39c2ec9059$export$f720fd0ddbeb53d9)(display) : {};
|
|
13472
|
+
displayParams[this.name] = this.value;
|
|
13473
|
+
searchParams.set("_display", (0, $7ae6ae39c2ec9059$export$c788aab010beeaec)(displayParams));
|
|
13474
|
+
const path = location.href.replace(location.search, "");
|
|
13475
|
+
this.navigateTo(`${path}?${searchParams.toString()}`);
|
|
13476
|
+
}
|
|
13477
|
+
};
|
|
13478
|
+
}
|
|
13479
|
+
|
|
13480
|
+
|
|
13350
13481
|
var $9b24cbeb3a465447$exports = {};
|
|
13351
13482
|
|
|
13352
13483
|
$parcel$defineInteropFlag($9b24cbeb3a465447$exports);
|
|
@@ -13435,7 +13566,10 @@ function $e773f8ef556b41ff$export$2e2bcd8739ae039() {
|
|
|
13435
13566
|
}
|
|
13436
13567
|
|
|
13437
13568
|
|
|
13438
|
-
$
|
|
13569
|
+
$fe98e3f2bf49b28f$exports = {
|
|
13570
|
+
"display_options": {
|
|
13571
|
+
"field": $6a9b69d9cc7f810f$exports
|
|
13572
|
+
},
|
|
13439
13573
|
"nav": {
|
|
13440
13574
|
"item": $9b24cbeb3a465447$exports
|
|
13441
13575
|
},
|
|
@@ -13510,12 +13644,11 @@ const $d73574cc5e9b9e72$var$prefix = window.APP_NAME;
|
|
|
13510
13644
|
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $d709d0f4027033b2$export$2e2bcd8739ae039));
|
|
13511
13645
|
[
|
|
13512
13646
|
$1f889267678ff167$exports,
|
|
13513
|
-
$
|
|
13647
|
+
$fe98e3f2bf49b28f$exports,
|
|
13514
13648
|
$6c10158820e535ef$exports
|
|
13515
13649
|
].forEach((scripts)=>{
|
|
13516
13650
|
const components = (0, $5439cede634b2921$export$4e811121b221213b)(scripts);
|
|
13517
13651
|
Object.keys(components).forEach((name)=>{
|
|
13518
|
-
console.log(name);
|
|
13519
13652
|
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data(`${name}Component`, components[name]);
|
|
13520
13653
|
});
|
|
13521
13654
|
});
|