sauvegarde le travail accompli

This commit is contained in:
gcch 2025-04-22 07:28:32 +02:00
commit 26165682d9
521 changed files with 4919 additions and 17279 deletions

View file

@ -123,7 +123,9 @@ $email = WC()->customer->get_billing_email();
$adresse_livraison = WC()->customer->get_shipping();
$adresse_facturation = WC()->customer->get_billing();
$adresse_renseignee = $adresse_livraison["city"] != "";
$pays_livraison = collect(WC()->countries->get_countries())->only($pays_acceptes)->toArray();
$pays_livraison = collect(WC()->countries->get_countries())
->only($pays_acceptes)
->toArray();
$total_livraison = Number::format(floatval(WC()->cart->get_totals()["shipping_total"]), precision: 0);
$methodes_livraison = collect(WC()->session->get("shipping_for_package_0")["rates"])
->values()
@ -165,9 +167,9 @@ function charge_scripts_styles_page_panier(): void {
);
wp_enqueue_script_module(
id: "haiku-atelier-2024-scripts-page-panier",
src: get_template_directory_uri() . "/assets/js/scripts-page-panier.js",
src: get_template_directory_uri() . "/assets/js/scripts-page-cart.js",
deps: [],
version: filemtime(get_template_directory() . "/assets/js/scripts-page-panier.js"),
version: filemtime(get_template_directory() . "/assets/js/scripts-page-cart.js"),
);
}
add_action("wp_enqueue_scripts", "charge_scripts_styles_page_panier");

View file

@ -0,0 +1,4 @@
export const CATALOG_VISIBILITIES = {
INVISIBLE: "invisible",
VISIBLE: "visible",
} as const;

View file

@ -0,0 +1,118 @@
import { Schema } from "effect";
import { CATALOG_VISIBILITIES } from "./constants";
export class CartItemTotals extends Schema.Class<CartItemTotals>("CartItemTotals")({
currency_code: Schema.String,
currency_decimal_separator: Schema.String,
currency_minor_unit: Schema.Number,
currency_prefix: Schema.String,
currency_suffix: Schema.String,
currency_symbol: Schema.String,
currency_thousand_separator: Schema.String,
line_subtotal: Schema.String,
line_subtotal_tax: Schema.String,
line_total: Schema.String,
line_total_tax: Schema.String,
}) {}
export class CartItem extends Schema.Class<CartItem>("CartItem")({
backorders_allowed: Schema.Boolean,
catalog_visibility: Schema.Enums(CATALOG_VISIBILITIES),
description: Schema.String,
extensions: Schema.Unknown,
id: Schema.Number,
images: Schema.Array(Schema.Unknown),
item_data: Schema.Array(Schema.Unknown),
key: Schema.String,
low_stock_remaining: Schema.Unknown,
name: Schema.String,
permalink: Schema.URL,
prices: Schema.Unknown,
quantity: Schema.Number,
quantity_limits: Schema.Unknown,
short_description: Schema.String,
show_backorder_badge: Schema.Boolean,
sku: Schema.String,
sold_individually: Schema.Boolean,
totals: CartItemTotals,
type: Schema.String,
variation: Schema.Array(Schema.Unknown),
}) {}
export class CartTotals extends Schema.Class<CartTotals>("CartTotals")({
currency_code: Schema.String,
currency_decimal_separator: Schema.String,
currency_minor_unit: Schema.Number,
currency_prefix: Schema.String,
currency_suffix: Schema.String,
currency_symbol: Schema.String,
currency_thousand_separator: Schema.String,
tax_lines: Schema.Array(Schema.Unknown),
total_discount: Schema.NumberFromString,
total_discount_tax: Schema.String,
total_fees: Schema.String,
total_fees_tax: Schema.String,
total_items: Schema.NumberFromString,
total_items_tax: Schema.String,
total_price: Schema.NumberFromString,
total_shipping: Schema.NumberFromString,
total_shipping_tax: Schema.Union(Schema.String, Schema.Null),
total_tax: Schema.String,
}) {}
export class Cart extends Schema.Class<Cart>("Cart")({
billing_address: Schema.Unknown,
/** List of applied basket coupons. */
coupons: Schema.Array(Schema.Unknown),
cross_sells: Schema.Unknown,
errors: Schema.Unknown,
extensions: Schema.Unknown,
fees: Schema.Unknown,
has_calculated_shipping: Schema.Boolean,
items: Schema.Array(CartItem),
items_count: Schema.Int,
items_weight: Schema.Int,
needs_payment: Schema.Boolean,
needs_shipping: Schema.Boolean,
payment_methods: Schema.Unknown,
payment_requirements: Schema.Unknown,
shipping_address: Schema.Unknown,
shipping_rates: Schema.Array(Schema.Unknown),
totals: CartTotals,
}) {}
// Requêtes.
export class CartUpdateItemArgs extends Schema.Class<CartUpdateItemArgs>("CartUpdateItemArgs")({
/** Unique identifier (key) for the basket item to update. */
key: Schema.String,
/** New quantity of the item in the basket. */
quantity: Schema.Number.pipe(Schema.greaterThan(1)),
}) {}
export class CartRemoveItemArgs extends Schema.Class<CartRemoveItemArgs>("CartRemoveItemArgs")({
/** Unique identifier (key) for the basket item. */
key: Schema.String,
}) {}
// export const WCStoreCartSchema = v.object({
// billing_address: WCStoreBillingAddressSchema,
// /** List of applied basket coupons. */
// coupons: v.array(WCStoreCartCouponsSchema),
// cross_sells: v.unknown(),
// errors: v.unknown(),
// extensions: v.unknown(),
// fees: v.unknown(),
// has_calculated_shipping: v.boolean(),
// items: v.array(WCStoreCartItemSchema),
// items_count: v.pipe(v.number(), v.integer()),
// items_weight: v.pipe(v.number(), v.integer()),
// needs_payment: v.boolean(),
// needs_shipping: v.boolean(),
// payment_methods: v.unknown(),
// payment_requirements: v.unknown(),
// shipping_address: WCStoreShippingAddressSchema,
// shipping_rates: v.array(WCStoreShippingRateSchema),
// totals: WCStoreCartTotalsSchema,
// });

View file

@ -0,0 +1,125 @@
import type { NonEmptyReadonlyArray } from "effect/Array";
import { Effect, identity, pipe } from "effect";
import { describe, expect, test } from "vitest";
import { mayGetDOMElement, mayGetDOMElements } from "./dom";
import { SelectorWithoutMatchError } from "./errors";
describe("safeGetDOMElement()", () => {
test("safeGetDOMElement retourne un Élément pour un sélecteur avec résultat", () => {
const parent = document.createElement("div");
const child1 = document.createElement("p");
const child2 = document.createElement("p");
child1.textContent = "Je suis un paragraphe de texte.";
child1.classList.add("classe");
child2.textContent = "Je suis un autre paragraphe de texte.";
parent.append(child1, child2);
const selector = "p.classe";
expect(pipe(
mayGetDOMElement(parent)<HTMLParagraphElement>(selector),
Effect.runSync,
)).toEqual(child1);
});
test("safeGetDOMElement retourne SelectorWithoutMatchError pour un sélecteur sans résultats", () => {
const parent = document.createElement("div");
const child1 = document.createElement("p");
const child2 = document.createElement("p");
child1.textContent = "Je suis un paragraphe de texte.";
child2.textContent = "Je suis un autre paragraphe de texte.";
parent.append(child1, child2);
const selector = "p.classe";
expect(pipe(
mayGetDOMElement(parent)<HTMLParagraphElement>(selector),
Effect.match({
onFailure: err => err instanceof SelectorWithoutMatchError,
onSuccess: identity,
}),
Effect.runSync,
)).toBe(true);
});
test("safeGetDOMElement retourne SelectorWithoutMatchError pour un sélecteur illégal", () => {
const parent = document.createElement("div");
const child1 = document.createElement("p");
const child2 = document.createElement("p");
child1.textContent = "Je suis un paragraphe de texte.";
child2.textContent = "Je suis un autre paragraphe de texte.";
parent.append(child1, child2);
const selector = "p:illegal-pseudo";
expect(pipe(
mayGetDOMElement(parent)<HTMLParagraphElement>(selector),
Effect.match({
onFailure: err => err instanceof SelectorWithoutMatchError,
onSuccess: identity,
}),
Effect.runSync,
)).toBe(true);
});
});
describe("safeGetDOMElements()", () => {
test("safeGetDOMElements() retourne plusieurs Éléments pour un sélecteur avec résultats", () => {
const parent = document.createElement("div");
const child1 = document.createElement("p");
const child2 = document.createElement("p");
const wanted: NonEmptyReadonlyArray<HTMLParagraphElement> = [child1, child2];
child1.textContent = "Je suis un paragraphe de texte.";
child2.textContent = "Je suis un autre paragraphe de texte.";
parent.append(child1, child2);
const selector = "p";
expect(pipe(
mayGetDOMElements(parent)<HTMLParagraphElement>(selector),
Effect.runSync,
)).toEqual(wanted);
});
test("safeGetDOMElement retourne SelectorWithoutMatchError pour un sélecteur sans résultats", () => {
const parent = document.createElement("div");
const child1 = document.createElement("p");
const child2 = document.createElement("p");
child1.textContent = "Je suis un paragraphe de texte.";
child2.textContent = "Je suis un autre paragraphe de texte.";
parent.append(child1, child2);
const selector = "li";
expect(pipe(
mayGetDOMElements(parent)<HTMLParagraphElement>(selector),
Effect.match({
onFailure: err => err instanceof SelectorWithoutMatchError,
onSuccess: identity,
}),
Effect.runSync,
)).toBe(true);
});
test("safeGetDOMElement retourne SelectorWithoutMatchError pour un sélecteur illégal", () => {
const parent = document.createElement("div");
const child1 = document.createElement("p");
const child2 = document.createElement("p");
child1.textContent = "Je suis un paragraphe de texte.";
child2.textContent = "Je suis un autre paragraphe de texte.";
parent.append(child1, child2);
const selector = "p:illegal-pseudo";
expect(pipe(
mayGetDOMElements(parent)<HTMLParagraphElement>(selector),
Effect.match({
onFailure: err => err instanceof SelectorWithoutMatchError,
onSuccess: identity,
}),
Effect.runSync,
)).toBe(true);
});
});

View file

@ -0,0 +1,73 @@
import type { NonEmptyReadonlyArray as NERA } from "effect/Array";
import type { NoSuchElementException } from "effect/Cause";
import { Effect, pipe } from "effect";
import type { ParentElement } from "../../../scripts/lib/types/dom";
import { isNonEmptyReadonlyArray } from "../validation";
import { SelectorWithoutMatchError } from "./errors";
/**
* Récupère un Élément manière sûre au sein d'un Nœud DOM.
*
* @param parent Le Nœud dans lequel récupérer l'Élément.
* @param selector Le sélecteur de l'Élément souhaité.
*
* @returns Un Effect avec soit l'Élément souhaité, soit une SyntaxError pour un sélecteur malformé ou ne débouchant sur aucun résultat.
*/
export const mayGetDOMElement =
(parent: ParentElement) =>
<E extends Element = Element>(selector: string): Effect.Effect<E, SelectorWithoutMatchError> =>
pipe(
Effect.try(() => parent.querySelector<E>(selector)),
Effect.andThen(Effect.fromNullable),
Effect.mapError(_ => new SelectorWithoutMatchError({ selector })),
);
export const mayGetDOMElements =
(parent: ParentElement) =>
<E extends Element = Element>(selector: string): Effect.Effect<NERA<E>, SelectorWithoutMatchError> =>
pipe(
Effect.try(() => pipe(parent.querySelectorAll<E>(selector), Array.from<E>)),
Effect.andThen(xs => isNonEmptyReadonlyArray(xs)),
Effect.mapError(_ => new SelectorWithoutMatchError({ selector })),
);
export const mustGetDOMElement = (parent: ParentElement) => <E extends Element = Element>(selector: string): E =>
pipe(
mayGetDOMElement(parent)<E>(selector),
Effect.orDie,
Effect.runSync,
);
export const mustGetDOMElements = (parent: ParentElement) => <E extends Element = Element>(selector: string): NERA<E> =>
pipe(
mayGetDOMElements(parent)<E>(selector),
Effect.orDie,
Effect.runSync,
);
/**
* Convertis une chaîne JSON en un objet JavaScript sous forme d'`Effect`.
*
* @param chaine La chaîne à convertir.
*
* @returns Un `Effect` avec soit un objet JS, soit une SyntaxError en cas de chaîne invalide.
*/
export const mayParseJSON = (chaine: string): Effect.Effect<JSONValue, SyntaxError> =>
Effect.try(() => JSON.parse(chaine));
export const mayStringifyJSON = <T>(json: T): Effect.Effect<string, NoSuchElementException | TypeError> =>
pipe(
Effect.try(() => JSON.stringify(json)),
Effect.andThen(Effect.fromNullable),
);
/**
* Vérifie qu'un sélecteur s'applique à l'élément DOM d'une cible d'événement (un `EventTarget`) donnée.
*
* @returns Un booléen
*/
export const targetMatchesSelector = (selector: string) => (target: EventTarget | null): boolean =>
target !== null && (target as HTMLElement).matches(selector);

View file

@ -0,0 +1,16 @@
import { Data } from "effect";
/** SelectorWithoutMatchError correspond à l'usage d'un sélecteur ne retournant aucun résultat. */
export class SelectorWithoutMatchError
extends Data.TaggedError("SelectorWithoutMatchError")<{ readonly selector: string }>
{
customMessage: string;
constructor(props: { readonly selector: string }) {
super(props);
this.customMessage = `Le selecteur ${this.selector} n'a retourné aucun résultat.`;
}
}
/** UnknownKeyArror correspond à la récupération d'une entrée avec une clé inexistante. */
export class UnknownKeyError extends Data.TaggedError("UnknownKeyArror")<{ key: string }> {}

View file

@ -0,0 +1,15 @@
import { captureException } from "@sentry/core";
import { logger } from "../logging";
import { SelectorWithoutMatchError } from "./dom/dom";
export const reportAndReturnError = <E extends Error>(err: E): E => {
captureException(err);
logger.error(err);
if (err instanceof SelectorWithoutMatchError) {
logger.error(err.customMessage);
}
return err;
};

View file

@ -0,0 +1,54 @@
import type { NoSuchElementException } from "effect/Cause";
import type { ParseError } from "effect/ParseResult";
import { Effect, pipe, Schema } from "effect";
import { mayParseJSON, mayStringifyJSON } from "./dom/dom";
/**
* Récupère de manière sûre une entrée dans le `LocalStorage`.
*
* @param key La clé de l'Entrée dans le `LocalStorage` souhaitée.
* @param itemSchema Le Schéma auquel l'entrée retournée doit correspondre.
* @throws `NoSuchElementException` L'entrée du `LocalStorage` contient `null`.
* @throws `ParseError` Erreur lors de la vérification du Schéma.
* @throws `SyntaError` La chaîne à convertir en _JSON_ n'est pas valide.
* @returns Un `Effect` contenant la valeur contenue dans l'entrée du `LocalStorage`.
*/
export const mayGetLocalStorageByKey = <S>(
key: string,
itemSchema: Schema.Schema<S, S>,
): Effect.Effect<S, NoSuchElementException | ParseError | SyntaxError> =>
pipe(
// Filtre les valeurs null.
Effect.fromNullable(localStorage.getItem(key)),
// Convertis depuis le JSON et vérifie le Schéma.
Effect.andThen((item: string) => mayParseJSON(item)),
Effect.andThen((json: JSONValue) => Schema.decodeUnknown(itemSchema)(json)),
);
/**
* Enregistre de manière sûre une entrée dans le `LocalStorage`.
*
* @param key La clé de l'Entrée dans le `LocalStorage` souhaitée.
* @param itemSchema Le Schéma auquel la valeur de l'entrée à enregistrer doit correspondre.
* @throws `DOMException` `QuotaExceededError` a é rencontrée lors de l'enregistrement dans le `LocalStorage`.
* @throws `NoSuchElementException` La conversion de _JSON_ à chaîne a retournée `null`.
* @throws `ParseError` Erreur lors de la vérification du Schéma.
* @throws `TypeError` Une référence circulaire ou un `BigInt` sont présents dans le JSON.
* @returns Un `Effect` sans valeur de retour.
*/
export const maySetLocalStorageItem =
<S>(key: string, itemSchema: Schema.Schema<S, S>) =>
(value: unknown): Effect.Effect<void, DOMException | NoSuchElementException | ParseError | TypeError> =>
pipe(
// Vérifie le Schéma.
Schema.decodeUnknown(itemSchema)(value),
Effect.andThen((value: S) => mayStringifyJSON(value)),
Effect.andThen((value: string) =>
Effect.try({
catch: (error: unknown) => new DOMException(`Erreur à l'enregistrement dans le LocalStorage : ${error}`),
try: (): void => localStorage.setItem(key, value),
})
),
);

View file

@ -0,0 +1,28 @@
import { Data } from "effect";
/**
* Erreur survenant en cas de code HTTP 400 Bad Request.
*/
export class HttpBadRequestError extends Data.TaggedError("HttpBadRequestError")<{
message: string;
}> {}
/**
* Erreur survenant en cas de code HTTP 403 Forbidden.
*/
export class HttpForbiddenError extends Data.TaggedError("HttpForbiddenError")<{ message: string }> {}
/**
* Erreur survenant en cas de code HTTP 404 Not Found.
*/
export class HttpNotFoundError extends Data.TaggedError("HttpNotFoundError")<{ message: string }> {}
/**
* Erreur survenant en cas de code HTTP 500 Server Error.
*/
export class HttpServerError extends Data.TaggedError("HttpServerError")<{ message: string }> {}
/**
* Erreur survenant en cas de code HTTP 401 Unauthorized Error.
*/
export class HttpUnauthorizedError extends Data.TaggedError("HttpUnauthorizedError")<{ message: string }> {}

View file

@ -0,0 +1,80 @@
import type { HttpBody } from "@effect/platform/HttpBody";
import { FetchHttpClient, HttpClientRequest, type HttpClientResponse } from "@effect/platform";
import { Effect, Layer, Match } from "effect";
import { UnknownException } from "effect/Cause";
import { ENTETE_WC_NONCE } from "../../../scripts/constantes/api";
import {
HttpBadRequestError,
HttpForbiddenError,
HttpNotFoundError,
HttpServerError,
HttpUnauthorizedError,
} from "./errors";
const HttpGETClient = FetchHttpClient.layer.pipe(
Layer.provide(
Layer.succeed(FetchHttpClient.RequestInit, {
credentials: "same-origin",
headers: {
Accept: "application/json",
},
method: "GET",
mode: "same-origin",
}),
),
);
export const HttpPOSTClient = FetchHttpClient.layer.pipe(
Layer.provide(
Layer.succeed(FetchHttpClient.RequestInit, {
credentials: "same-origin",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
method: "POST",
mode: "same-origin",
}),
),
);
/** Un objet des en-têtes d'authentification pris en charge par le backend. */
export interface HandledAuthorizationHeaders {
authString?: string;
nonce?: string;
}
export const createAuthorizationHeaders = (headersValues: HandledAuthorizationHeaders): Record<string, string> => {
return {
...(headersValues.nonce && { [ENTETE_WC_NONCE]: headersValues.nonce }),
...(headersValues.authString && { Authorization: `Basic ${headersValues.authString}` }),
};
};
/** Un type union de tous les codes HTTP d'erreurs pris en charge. */
export type HttpStatusErrors =
| HttpBadRequestError
| HttpForbiddenError
| HttpNotFoundError
| HttpServerError
| HttpUnauthorizedError;
export const matchHttpStatus = (
res: HttpClientResponse.HttpClientResponse,
): Effect.Effect<HttpClientResponse.HttpClientResponse, HttpStatusErrors | UnknownException> =>
Match.value(res).pipe(
Match.when({ status: 200 }, r => Effect.succeed(r)),
Match.when({ status: 400 }, () => Effect.fail(new HttpBadRequestError({ message: "400 Bad Request" }))),
Match.when({ status: 401 }, () => Effect.fail(new HttpUnauthorizedError({ message: "401 Unauthorized" }))),
Match.when({ status: 403 }, () => Effect.fail(new HttpForbiddenError({ message: "403 Forbidden" }))),
Match.when({ status: 404 }, () => Effect.fail(new HttpNotFoundError({ message: "404 Not Found" }))),
Match.when({ status: 500 }, () => Effect.fail(new HttpServerError({ message: "400 Server Error" }))),
Match.orElse(r => Effect.fail(new UnknownException(r.status.toString()))),
);
// La validation des arguments a été faite en amont.
export const createPOSTFetch =
(route: string, headers: HandledAuthorizationHeaders) => (body: HttpBody): HttpClientRequest.HttpClientRequest =>
HttpClientRequest.post(route, { body, headers: createAuthorizationHeaders(headers) });

View file

@ -0,0 +1,8 @@
import { Effect } from "effect";
import { isNonEmptyReadonlyArray as isNERArray, type NonEmptyReadonlyArray } from "effect/Array";
import { NoSuchElementException } from "effect/Cause";
export const isNonEmptyReadonlyArray = <T>(
xs: ReadonlyArray<T>,
): Effect.Effect<NonEmptyReadonlyArray<T>, NoSuchElementException> =>
isNERArray(xs) ? Effect.succeed(xs) : Effect.fail(new NoSuchElementException());

View file

@ -0,0 +1,24 @@
import { ATTRIBUT_DESACTIVE, ATTRIBUT_HIDDEN } from "../../../scripts/constantes/dom";
import { E } from "../../../scripts/page-panier/scripts-page-panier-elements";
import { mustGetDOMElements } from "../../lib-effect/dom";
export const initAddressesSplitToggle = (): void => {
const billingAddressFields = mustGetDOMElements(E.FORMULAIRE_FACTURATION)<HTMLInputElement | HTMLSelectElement>(
"input, select",
);
E.BOUTON_SEPARATION_ADRESSES.addEventListener("click", (): void => {
if (E.BOUTON_SEPARATION_ADRESSES.checked) {
// Les Adresses sont séparées.
E.FORMULAIRE_FACTURATION.removeAttribute(ATTRIBUT_HIDDEN);
billingAddressFields.forEach(f => f.setAttribute(ATTRIBUT_DESACTIVE, ""));
} else {
// Les Adresses sont les même.
E.FORMULAIRE_FACTURATION.setAttribute(ATTRIBUT_HIDDEN, "");
billingAddressFields.forEach(f => {
f.setAttribute(ATTRIBUT_DESACTIVE, "");
f.value = "";
});
}
});
};

View file

@ -0,0 +1,155 @@
import type { NonEmptyReadonlyArray } from "effect/Array";
import { Array, Effect, Option, pipe, Schema } from "effect";
import { match } from "ts-pattern";
import type { SelectorWithoutMatchError } from "../../lib/dom/errors";
import {
ATTRIBUT_CLE_PANIER,
ATTRIBUT_DESACTIVE,
SELECTEUR_BOUTON_ADDITION_QUANTITE,
SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE,
SELECTEUR_BOUTON_SUPPRESSION_PANIER,
} from "../../../scripts/constantes/dom";
import { CartRemoveItemArgs, CartUpdateItemArgs } from "../../lib/cart/schemas";
import { targetMatchesSelector } from "../../lib/dom/dom";
import { API } from "../../services/api";
import {
type CartEntryContext,
type CartEntryInteractiveElements,
getCartEntryInteractiveElements,
} from "../../services/context";
import { CartPageElements } from "../../services/elements";
import { PAGE_STATES } from "./scripts-page-cart-state";
// Interfaces
type UpdateOperation = "DECREMENT" | "INCREMENT";
// Fonctions
/**
* Met à jour l'état (activé/désactivé) des Éléments DOM interactifs (boutons, champ de quantité) d'une Entrée de Panier.
*
* @param shouldActivate Est-ce que les Éléments interactifs sont à activer.
* @param eles Les Éléments DOM à mettre à jour.
* @returns L'objet des Éléments DOM interactifs passé en argument.
*/
const updateCartEntryInteractiveElements =
(shouldActivate: boolean) => (elements: CartEntryInteractiveElements): CartEntryInteractiveElements => {
if (shouldActivate) {
Number(elements.quantityInput.value) === 1
? elements.substractionButton.setAttribute(ATTRIBUT_DESACTIVE, "")
: elements.substractionButton.removeAttribute(ATTRIBUT_DESACTIVE);
elements.additionButton.removeAttribute(ATTRIBUT_DESACTIVE);
elements.deletionButton.removeAttribute(ATTRIBUT_DESACTIVE);
elements.deletionButton.textContent = "Remove";
} else {
elements.substractionButton.setAttribute(ATTRIBUT_DESACTIVE, "");
elements.additionButton.setAttribute(ATTRIBUT_DESACTIVE, "");
elements.deletionButton.setAttribute(ATTRIBUT_DESACTIVE, "");
elements.deletionButton.textContent = "Loading";
}
return elements;
};
/**
* Enclenche la mise à jour de l'état (activé/désactivé) des Éléments DOM interactifs (boutons, champ de quantité) des Entrées du Panier.
*
* @param shouldActivate Est-ce que les Éléments interactifs sont à activer.
* @param entries Les entrées du Panier sous forme de tableau d'Éléments.
* @returns Rien.
*/
export const refreshCartEntriesInteractiveElements =
(shouldActivate: boolean) => (entries: NonEmptyReadonlyArray<HTMLElement>): void =>
pipe(
Array.map(entries, (entry: HTMLElement): CartEntryInteractiveElements => getCartEntryInteractiveElements(entry)),
Array.forEach(elements => updateCartEntryInteractiveElements(shouldActivate)(elements)),
);
/**
* Génère la Requête API pour l'incrémentation de la quantité d'une Entrée de Panier.
*
* @param context Les informations et Éléments DOM d'intérêt de l'Entrée du Panier.
* @param operation Le type d'opération souhaitée sur la quantité.
* @returns Un `Effect` de la requête API pour l'incrémentation de la quantité.
*/
export const updateCartEntryQuantity = (
context: CartEntryContext,
operation: UpdateOperation,
) =>
// Injecte le Service API.
Effect.andThen(API, (api: API) =>
pipe(
// Créé de manière sûre les arguments de la Requête de mise à jour de l'Entrée du Panier.
Schema.decodeUnknown(CartUpdateItemArgs)({
key: context.cartKey,
quantity: operation === "INCREMENT"
? context.interactiveElements.quantityInput.valueAsNumber + 1
: context.interactiveElements.quantityInput.valueAsNumber - 1,
}),
// Désactive les Éléments interactifs des Entrées du Panier.
Effect.tap(() => refreshCartEntriesInteractiveElements(false)(context.cartEntries)),
// Génère la Requête.
Effect.andThen(args => api.CartItemUpdate({ nonce: PAGE_STATES.nonce })(args)),
));
export const removeCartEntry = (context: CartEntryContext) =>
// Injecte le Service API.
Effect.andThen(API, (api: API) =>
pipe(
// Créé de manière sûre l'argument pour la requête de suppression du Panier.
Schema.decodeUnknown(CartRemoveItemArgs)({ key: context.cartKey }),
// Désactive les Éléments interactifs des Entrées du Panier.
Effect.tap(() => refreshCartEntriesInteractiveElements(false)(context.cartEntries)),
// Génère la Requête.
Effect.andThen(args => api.CartItemRemove({ nonce: PAGE_STATES.nonce })(args)),
));
export const initCartEntriesInteractiveElements = (): Effect.Effect<void, SelectorWithoutMatchError> =>
Effect.gen(function*() {
const elements: CartPageElements = yield* CartPageElements;
const cartEntries: NonEmptyReadonlyArray<HTMLElement> = yield* elements.ENTREES_PANIER;
Array.forEach(cartEntries, (entry: HTMLElement) => {
const context: CartEntryContext = {
cartEntries: cartEntries,
cartKey: pipe(
Option.fromNullable(entry.getAttribute(ATTRIBUT_CLE_PANIER)),
Option.getOrElse(() => "-1"),
),
interactiveElements: getCartEntryInteractiveElements(entry),
};
entry.addEventListener("click", (event: Event): void => {
match(event.target)
.when(
targetMatchesSelector(SELECTEUR_BOUTON_ADDITION_QUANTITE),
() =>
updateCartEntryQuantity(context, "INCREMENT").pipe(
Effect.provide(API.Default),
Effect.runPromise,
),
)
.when(
targetMatchesSelector(SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE),
() =>
updateCartEntryQuantity(context, "DECREMENT").pipe(
Effect.provide(API.Default),
Effect.runPromise,
),
)
.when(
targetMatchesSelector(SELECTEUR_BOUTON_SUPPRESSION_PANIER),
() =>
removeCartEntry(context).pipe(
Effect.provide(API.Default),
Effect.runPromise,
),
)
.otherwise(_ => {});
});
});
}).pipe(Effect.provide(CartPageElements.Default));

View file

@ -0,0 +1,11 @@
/** États utiles pour les scripts de la page. */
interface PageStates {
/** Le jeton d'authentification des requêtes pour les versions plus récents de l'API WooCommerce. */
authString: string;
/** Un nonce pour l'authentification de requêtes API vers le backend WooCommerce. */
nonce: string;
}
// @ts-expect-error -- États injectés par le modèle PHP
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- États injectés par le modèle PHP
export const PAGE_STATES: PageStates = _etats;

View file

@ -0,0 +1,107 @@
import type { HttpBodyError } from "@effect/platform/HttpBody";
import type { HttpClientError } from "@effect/platform/HttpClientError";
import type { HttpClientRequest } from "@effect/platform/HttpClientRequest";
import type { TimeoutException, UnknownException } from "effect/Cause";
import type { ParseError } from "effect/ParseResult";
import { HttpBody, HttpClient, HttpClientResponse } from "@effect/platform";
import { Duration, Effect, pipe, Schedule } from "effect";
import type { WCStoreCartUpdateItemArgs } from "../../scripts/lib/types/api/cart-update-item";
import { ROUTE_API_MAJ_ARTICLE_PANIER, ROUTE_API_RETIRE_ARTICLE_PANIER } from "../../scripts/constantes/api";
import { Cart, type CartRemoveItemArgs } from "../lib/cart/schemas";
import {
createPOSTFetch,
type HandledAuthorizationHeaders,
HttpPOSTClient,
type HttpStatusErrors,
matchHttpStatus,
} from "../lib/network/network";
/**
* L'union des erreurs possibles au sein d'une requête API :
* 1. La conversion des arguments en JSON échoue (`HttpBodyError`).
* 2. Une erreur de requête ou de réponse lors de l'exécution du `fetch` (`HttpClientError`).
* 3. La requête a expirée (`TimeoutError`).
* 4. Le code de statut HTTP de la réponse n'est pas 200 (`HttpStatusError`).
* 5. Le code de statut HTTP de la réponse n'est pas pris en charge (`UnknownException`).
* 6. La forme du corps de la réponse ne correspond pas au schéma attendu (`ParseError`).
*/
export type APIRequestErrors =
| HttpBodyError
| HttpClientError
| HttpStatusErrors
| ParseError
| TimeoutException
| UnknownException;
const cartItemRemove =
(authHeaders: HandledAuthorizationHeaders) => (args: CartRemoveItemArgs): Effect.Effect<Cart, APIRequestErrors> =>
pipe(
// Convertis de manière sûre en JSON.
HttpBody.json(args),
// Créé la requête de mise à jour de l'Entrée auprès du backend.
Effect.andThen((body: HttpBody.Uint8Array): HttpClientRequest =>
createPOSTFetch(ROUTE_API_RETIRE_ARTICLE_PANIER, authHeaders)(body)
),
// Exécute la requête, la faisant expirer au bout de 15 secondes et la réessayant 3 fois avec un délai exponentiel.
Effect.andThen((req: HttpClientRequest) => HttpClient.execute(req)),
Effect.timeout(Duration.seconds(15)),
Effect.retry({
schedule: Schedule.exponential(Duration.seconds(10), 2),
times: 3,
while: err => err._tag === "RequestError",
}),
// Discrimine la Réponse en fonction du code de status HTTP.
Effect.andThen((res: HttpClientResponse.HttpClientResponse) => matchHttpStatus(res)),
// Le corps de la Réponse doit être un Panier.
Effect.andThen((res: HttpClientResponse.HttpClientResponse) =>
HttpClientResponse.schemaBodyJson(Cart, { errors: "all" })(res)
),
Effect.scoped,
Effect.provide(HttpPOSTClient),
);
/**
* @param authHeaders
* @param args
* @returns
*/
const cartItemUpdate =
(authHeaders: HandledAuthorizationHeaders) =>
(args: WCStoreCartUpdateItemArgs): Effect.Effect<Cart, APIRequestErrors> =>
pipe(
// Convertis de manière sûre en JSON.
HttpBody.json(args),
// Créé la requête de mise à jour de l'Entrée auprès du backend.
Effect.andThen((body: HttpBody.Uint8Array): HttpClientRequest =>
createPOSTFetch(ROUTE_API_MAJ_ARTICLE_PANIER, authHeaders)(body)
),
// Exécute la requête, la faisant expirer au bout de 15 secondes et la réessayant 3 fois avec un délai exponentiel.
Effect.andThen((req: HttpClientRequest) => HttpClient.execute(req)),
Effect.timeout(Duration.seconds(15)),
Effect.retry({
schedule: Schedule.exponential(Duration.seconds(10), 2),
times: 3,
while: err => err._tag === "RequestError",
}),
// Discrimine la Réponse en fonction du code de status HTTP.
Effect.andThen((res: HttpClientResponse.HttpClientResponse) => matchHttpStatus(res)),
// Le corps de la Réponse doit être un Panier.
Effect.andThen((res: HttpClientResponse.HttpClientResponse) =>
HttpClientResponse.schemaBodyJson(Cart, { errors: "all" })(res)
),
Effect.scoped,
Effect.provide(HttpPOSTClient),
);
export class API extends Effect.Service<API>()(
"API",
{
effect: Effect.succeed({
CartItemRemove: cartItemRemove,
CartItemUpdate: cartItemUpdate,
}),
},
) {}

View file

@ -0,0 +1,42 @@
import type { NonEmptyReadonlyArray } from "effect/Array";
import {
SELECTEUR_BOUTON_ADDITION_QUANTITE,
SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE,
SELECTEUR_BOUTON_SUPPRESSION_PANIER,
SELECTEUR_CHAMP_QUANTITE_LIGNE_PANIER,
} from "../../scripts/constantes/dom";
import { mustGetDOMElement } from "../lib/dom/dom";
export interface CartEntryInteractiveElements {
/** Le Bouton d'ajout de quantité d'un Produit. */
additionButton: HTMLButtonElement;
/** Le Bouton de suppression de l'Entrée du Panier. */
deletionButton: HTMLButtonElement;
/** Le champ de quantité de Produits d'une Entrée. */
quantityInput: HTMLInputElement;
/** Le Bouton de soustraction de quantité d'un Produit. */
substractionButton: HTMLButtonElement;
}
// TODO: Transformer ce Contexte en Service
export interface CartEntryContext {
cartEntries: NonEmptyReadonlyArray<HTMLElement>;
cartKey: string;
interactiveElements: CartEntryInteractiveElements;
}
/**
* Récupère les Éléments DOM interactifs (boutons, champ de quantité) d'une Entrée de Panier sous forme d'objet.
*
* Si les sélecteurs de ces Éléments ne retournent rien, une Erreur sera levée.
*
* @param entry L'Entrée de Panier sous forme d'Élément DOM.
* @returns Un objet des Éléments interactifs.
*/
export const getCartEntryInteractiveElements = (entry: HTMLElement): CartEntryInteractiveElements => ({
additionButton: mustGetDOMElement(entry)<HTMLButtonElement>(SELECTEUR_BOUTON_ADDITION_QUANTITE),
deletionButton: mustGetDOMElement(entry)<HTMLButtonElement>(SELECTEUR_BOUTON_SUPPRESSION_PANIER),
quantityInput: mustGetDOMElement(entry)<HTMLInputElement>(SELECTEUR_CHAMP_QUANTITE_LIGNE_PANIER),
substractionButton: mustGetDOMElement(entry)<HTMLButtonElement>(SELECTEUR_BOUTON_SOUSTRACTION_QUANTITE),
});

View file

@ -0,0 +1,82 @@
import { Effect } from "effect";
import {
SELECTEUR_BOUTON_ACTIONS_FORMULAIRE,
SELECTEUR_BOUTON_CODE_PROMO,
SELECTEUR_BOUTON_SEPARATION_ADRESSES,
SELECTEUR_CHAMP_CODE_PROMO,
SELECTEUR_CONTENEUR_METHODES_LIVRAISON,
SELECTEUR_CONTENEUR_PANIER,
SELECTEUR_ENSEMBLE_CODE_PROMO,
SELECTEUR_ENTREES_PANIER,
SELECTEUR_FORMULAIRE_FACTURATION,
SELECTEUR_FORMULAIRE_PANIER,
SELECTEUR_INSTRUCTIONS_CLIENT,
SELECTEUR_MESSAGE_CODE_PROMO,
SELECTEUR_MESSAGE_FORMULAIRE_ADRESSES,
SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT,
SELECTEUR_SOUS_TOTAL_PRODUITS,
SELECTEUR_TOTAL_PANIER,
SELECTEUR_TOTAL_REDUCTION,
SELECTEUR_TOTAL_REDUCTION_VALEUR,
} from "../../scripts/constantes/dom";
import { mayGetDOMElements, mustGetDOMElement } from "../lib/dom/dom";
export const E = {
BOUTON_ACTIONS_FORMULAIRE: mustGetDOMElement(document)<HTMLButtonElement>(SELECTEUR_BOUTON_ACTIONS_FORMULAIRE),
BOUTON_CODE_PROMO: mustGetDOMElement(document)<HTMLButtonElement>(SELECTEUR_BOUTON_CODE_PROMO),
BOUTON_SEPARATION_ADRESSES: mustGetDOMElement(document)<HTMLInputElement>(SELECTEUR_BOUTON_SEPARATION_ADRESSES),
CHAMP_CODE_PROMO: mustGetDOMElement(document)<HTMLInputElement>(SELECTEUR_CHAMP_CODE_PROMO),
CONTENEUR_METHODES_LIVRAISON: mustGetDOMElement(document)<HTMLFieldSetElement>(
SELECTEUR_CONTENEUR_METHODES_LIVRAISON,
),
CONTENEUR_PANIER: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_CONTENEUR_PANIER),
ENSEMBLE_CODE_PROMO: mustGetDOMElement(document)<HTMLFormElement>(SELECTEUR_ENSEMBLE_CODE_PROMO),
ENTREES_PANIER: mayGetDOMElements(document)<HTMLElement>(SELECTEUR_ENTREES_PANIER),
FORMULAIRE_FACTURATION: mustGetDOMElement(document)<HTMLDivElement>(SELECTEUR_FORMULAIRE_FACTURATION),
FORMULAIRE_PANIER: mustGetDOMElement(document)<HTMLFormElement>(SELECTEUR_FORMULAIRE_PANIER),
INSTRUCTIONS_CLIENT: mustGetDOMElement(document)<HTMLTextAreaElement>(SELECTEUR_INSTRUCTIONS_CLIENT),
MESSAGE_ADRESSES: mustGetDOMElement(document)<HTMLParagraphElement>(SELECTEUR_MESSAGE_FORMULAIRE_ADRESSES),
MESSAGE_CODE_PROMO: mustGetDOMElement(document)<HTMLParagraphElement>(SELECTEUR_MESSAGE_CODE_PROMO),
SOUS_TOTAL_LIVRAISON_VALEUR: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT),
SOUS_TOTAL_PRODUITS: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_SOUS_TOTAL_PRODUITS),
SOUS_TOTAL_PRODUITS_VALEUR: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_SOUS_TOTAL_PRODUITS),
SOUS_TOTAL_REDUCTION: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_REDUCTION_VALEUR),
SOUS_TOTAL_REDUCTION_VALEUR: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_REDUCTION_VALEUR),
TOTAL_PANIER: mustGetDOMElement(document)<HTMLParagraphElement>(SELECTEUR_TOTAL_PANIER),
TOTAL_PANIER_VALEUR: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_PANIER),
TOTAL_REDUCTION_LIGNE: mustGetDOMElement(document)<HTMLDivElement>(SELECTEUR_TOTAL_REDUCTION),
TOTAL_REDUCTION_VALEUR: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_REDUCTION_VALEUR),
};
export class CartPageElements extends Effect.Service<CartPageElements>()(
"CartPageElements",
{
effect: Effect.succeed({
BOUTON_ACTIONS_FORMULAIRE: mustGetDOMElement(document)<HTMLButtonElement>(SELECTEUR_BOUTON_ACTIONS_FORMULAIRE),
BOUTON_CODE_PROMO: mustGetDOMElement(document)<HTMLButtonElement>(SELECTEUR_BOUTON_CODE_PROMO),
BOUTON_SEPARATION_ADRESSES: mustGetDOMElement(document)<HTMLInputElement>(SELECTEUR_BOUTON_SEPARATION_ADRESSES),
CHAMP_CODE_PROMO: mustGetDOMElement(document)<HTMLInputElement>(SELECTEUR_CHAMP_CODE_PROMO),
CONTENEUR_METHODES_LIVRAISON: mustGetDOMElement(document)<HTMLFieldSetElement>(
SELECTEUR_CONTENEUR_METHODES_LIVRAISON,
),
CONTENEUR_PANIER: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_CONTENEUR_PANIER),
ENSEMBLE_CODE_PROMO: mustGetDOMElement(document)<HTMLFormElement>(SELECTEUR_ENSEMBLE_CODE_PROMO),
ENTREES_PANIER: mayGetDOMElements(document)<HTMLElement>(SELECTEUR_ENTREES_PANIER),
FORMULAIRE_FACTURATION: mustGetDOMElement(document)<HTMLDivElement>(SELECTEUR_FORMULAIRE_FACTURATION),
FORMULAIRE_PANIER: mustGetDOMElement(document)<HTMLFormElement>(SELECTEUR_FORMULAIRE_PANIER),
INSTRUCTIONS_CLIENT: mustGetDOMElement(document)<HTMLTextAreaElement>(SELECTEUR_INSTRUCTIONS_CLIENT),
MESSAGE_ADRESSES: mustGetDOMElement(document)<HTMLParagraphElement>(SELECTEUR_MESSAGE_FORMULAIRE_ADRESSES),
MESSAGE_CODE_PROMO: mustGetDOMElement(document)<HTMLParagraphElement>(SELECTEUR_MESSAGE_CODE_PROMO),
SOUS_TOTAL_LIVRAISON_VALEUR: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_SOUS_TOTAL_LIVRAISON_COUT),
SOUS_TOTAL_PRODUITS: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_SOUS_TOTAL_PRODUITS),
SOUS_TOTAL_PRODUITS_VALEUR: mustGetDOMElement(document)<HTMLElement>(SELECTEUR_SOUS_TOTAL_PRODUITS),
SOUS_TOTAL_REDUCTION: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_REDUCTION_VALEUR),
SOUS_TOTAL_REDUCTION_VALEUR: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_REDUCTION_VALEUR),
TOTAL_PANIER: mustGetDOMElement(document)<HTMLParagraphElement>(SELECTEUR_TOTAL_PANIER),
TOTAL_PANIER_VALEUR: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_PANIER),
TOTAL_REDUCTION_LIGNE: mustGetDOMElement(document)<HTMLDivElement>(SELECTEUR_TOTAL_REDUCTION),
TOTAL_REDUCTION_VALEUR: mustGetDOMElement(document)<HTMLSpanElement>(SELECTEUR_TOTAL_REDUCTION_VALEUR),
}),
},
) {}

View file

View file

@ -6,17 +6,7 @@ import type { ParentElement } from "./types/dom.d.ts";
import { ATTRIBUT_CHARGEMENT, ATTRIBUT_DESACTIVE } from "../constantes/dom.ts";
import { logger } from "../logging.ts";
import { lanceAnimationCycleLoading } from "./animations.ts";
import {
BadRequestError,
creeSyntaxError,
ERREUR_SELECTEUR_INEXISTANT,
ERREUR_SYNTAXE_INVALIDE,
ForbiddenError,
NotFoundError,
reporteEtLeveErreur,
ServerError,
UnauthorizedError,
} from "./erreurs";
import { createSyntaxError, ErrorInvalidSelector, ErrorNonExistingSelector, reporteEtLeveErreur } from "./erreurs.ts";
export const recupereElementAvecSelecteur =
(parent: ParentElement) => <E extends Element = Element>(selecteur: string): Either<SyntaxError, E> =>
@ -24,10 +14,10 @@ export const recupereElementAvecSelecteur =
// Retourne une SyntaxError dans un Left si le sélecteur est invalide
.encase(() => parent.querySelector<E>(selecteur))
// Transforme le Left en une erreur plus sympathique
.mapLeft(_ => creeSyntaxError(ERREUR_SYNTAXE_INVALIDE(selecteur)))
.mapLeft(_ => createSyntaxError(ErrorInvalidSelector(selecteur)))
// Retourne une SyntaxError si l'Élément est null
.chain((e: E | null) =>
G.isNotNullable(e) ? Right(e) : Left(creeSyntaxError(ERREUR_SELECTEUR_INEXISTANT(selecteur)))
G.isNotNullable(e) ? Right(e) : Left(createSyntaxError(ErrorNonExistingSelector(selecteur)))
);
export const getDOMElementsWithSelector =
@ -36,9 +26,9 @@ export const getDOMElementsWithSelector =
// Retourne une SyntaxError dans un Left si le sélecteur est invalide
.encase(() => pipe(parent.querySelectorAll<E>(selecteur), Array.from<E>))
// Transforme le Left en une erreur plus sympathique
.mapLeft(_ => creeSyntaxError(ERREUR_SYNTAXE_INVALIDE(selecteur)))
.mapLeft(_ => createSyntaxError(ErrorInvalidSelector(selecteur)))
// Retourne une SyntaxError si le tableau est vide
.chain((e: Array<E>) => A.isEmpty(e) ? Left(creeSyntaxError(ERREUR_SELECTEUR_INEXISTANT(selecteur))) : Right(e));
.chain((e: Array<E>) => A.isEmpty(e) ? Left(createSyntaxError(ErrorNonExistingSelector(selecteur))) : Right(e));
export const recupereElementOuLeve = <E extends Element = Element>(elementOuErreur: Either<SyntaxError, E>): E =>
elementOuErreur.caseOf({

View file

@ -10,20 +10,20 @@ import type { WCErrorBody } from "./types/api/erreurs";
import { ErreurAdresseInvalide } from "./erreurs/adresses";
/* Messages d'erreur */
export const ERREUR_SYNTAXE_INVALIDE = (selecteur: string): string => `Le selecteur "${selecteur}" est invalide`;
export const ERREUR_SELECTEUR_INEXISTANT = (selecteur: string): string =>
/** @deprecated */
export const ErrorInvalidSelector = (selecteur: string): string => `Le selecteur "${selecteur}" est invalide`;
/** @deprecated */
export const ErrorNonExistingSelector = (selecteur: string): string =>
`La requête "${selecteur}" n'a retourné aucun Élément.`;
export const InvalidSelectorError = (s: string): SyntaxError => new SyntaxError(`Le selecteur ${s} est invalide.`);
export const NoResultsSelectorError = (s: string): SyntaxError =>
new SyntaxError(`Le sélecteur ${s} n'a retourné aucun Élément.`);
/* Création d'erreurs */
export const creeSyntaxError = (message: string): SyntaxError => new SyntaxError(message);
export const createSyntaxError = (message: string): SyntaxError => new SyntaxError(message);
/* Types d'erreurs */
export class BadRequestError extends Error {
constructor(message = "400 BadRequestError") {
super(message);
this.name = "BadRequestError";
}
}
export class CleNonTrouveError extends Error {
constructor(message: unknown) {
super(JSON.stringify(message));
@ -36,36 +36,12 @@ export class DOMElementAbsentError extends Error {
this.name = "DOMElementAbsentError";
}
}
export class ForbiddenError extends Error {
constructor(message = "403 ForbiddenError") {
super(message);
this.name = "ForbiddenError";
}
}
export class NonExistingKeyError extends Error {
constructor(message: unknown) {
super(JSON.stringify(message));
this.name = "NonExistingKeyError";
}
}
export class NotFoundError extends Error {
constructor(message = "404 NotFoundError") {
super(message);
this.name = "NotFoundError";
}
}
export class ServerError extends Error {
constructor(message = "500 ServerError") {
super(message);
this.name = "ServerError";
}
}
export class UnauthorizedError extends Error {
constructor(message = "401 UnauthorizedError") {
super(message);
this.name = "UnauthorizedError";
}
}
export class UnknownError extends Error {
constructor(message: unknown) {
super(JSON.stringify(message));

View file

View file

View file

@ -0,0 +1,9 @@
import { Effect } from "effect";
import { initAddressesSplitToggle } from "./page-panier/effect/scripts-page-cart-forms";
import { initCartEntriesInteractiveElements } from "./page-panier/effect/scripts-page-cart-products";
document.addEventListener("DOMContentLoaded", (): void => {
initAddressesSplitToggle();
initCartEntriesInteractiveElements().pipe(Effect.runSync);
});

0
web/vendor/htmlburger/carbon-fields/.babelrc.js vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/.browserlistrc vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/.editorconfig vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/.eslintrc.js vendored Executable file → Normal file
View file

View file

@ -1,9 +0,0 @@
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
DEVELOPMENT.md export-ignore
phpcs.xml export-ignore
phpunit.xml export-ignore
Vagrantfile export-ignore

View file

@ -1,34 +0,0 @@
# Editors
project.xml
project.properties
/nbproject/private/
.buildpath
.project
.settings*
sftp-config.json
.idea
# OS X metadata
.DS_Store
# Windows thumbnail cache
Thumbs.db
# Node
node_modules
# Unit tests
/tmp
# Composer
/vendor
composer.lock
# Vagrant
.vagrant
# Bundled assets
/assets/dist/
carbon-fields.zip
package-lock.json

0
web/vendor/htmlburger/carbon-fields/.huskyrc.js vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/.lintstagedrc.js vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/.nvmrc vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/.phpstorm.meta.php/ioc.meta.php vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/.postcssrc.js vendored Executable file → Normal file
View file

View file

@ -1,74 +0,0 @@
filter:
excluded_paths:
- core/Pimple/*
- assets/*
- languages/*
- tests/*
- templates/*
- tmp/*
- vendor/*
checks:
php:
verify_argument_usable_as_reference: false
verify_property_names: false
no_global_keyword: false
psr2_class_declaration: false
avoid_superglobals: false
one_class_per_file: false
code_rating: true
coding_standard:
name: WordPress
tools:
sensiolabs_security_checker: true
external_code_coverage: true
php_mess_detector:
config:
code_size_rules: { cyclomatic_complexity: true, npath_complexity: true, excessive_method_length: true, excessive_class_length: true, excessive_parameter_list: true, excessive_public_count: true, too_many_fields: true, too_many_methods: true, excessive_class_complexity: true }
design_rules: { number_of_class_children: true, depth_of_inheritance: true, coupling_between_objects: true }
unused_code_rules: { unused_local_variable: true, unused_private_method: true, unused_formal_parameter: true }
naming_rules: { short_variable: true, long_variable: true, short_method: true, boolean_method_name: true }
controversial_rules: { camel_case_class_name: true, camel_case_property_name: true, camel_case_method_name: true, camel_case_parameter_name: true, camel_case_variable_name: true }
php_cs_fixer:
config:
level: all
fixers: { unused_use: true, phpdoc_params: true, braces: true, php_closing_tag: true }
php_analyzer:
config:
suspicious_code: { enabled: true, overriding_parameter: true, overriding_closure_use: true, parameter_closure_use_conflict: true, parameter_multiple_times: true, non_existent_class_in_instanceof_check: true, non_existent_class_in_catch_clause: true, assignment_of_null_return: true, non_commented_switch_fallthrough: true, non_commented_empty_catch_block: true, overriding_private_members: true, use_statement_alias_conflict: true, precedence_in_condition_assignment: true }
verify_php_doc_comments: { enabled: true, parameters: true, return: true, suggest_more_specific_types: true, ask_for_return_if_not_inferrable: true, ask_for_param_type_annotation: true }
loops_must_use_braces: { enabled: true }
simplify_boolean_return: { enabled: true }
phpunit_checks: { enabled: true }
reflection_fixes: { enabled: true }
use_statement_fixes: { enabled: true, order_alphabetically: true, remove_unused: true, preserve_multiple: false, preserve_blanklines: false }
parameter_reference_check: { enabled: false }
checkstyle: { enabled: false, no_trailing_whitespace: true, naming: { enabled: true, local_variable: '^[a-z][a-zA-Z0-9]*$', abstract_class_name: ^Abstract|Factory$, utility_class_name: 'Utils?$', constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$', property_name: '^[a-z][a-zA-Z0-9]*$', method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$', parameter_name: '^[a-z][a-zA-Z0-9]*$', interface_name: '^[A-Z][a-zA-Z0-9]*Interface$', type_name: '^[A-Z][a-zA-Z0-9]*$', exception_name: '^[A-Z][a-zA-Z0-9]*Exception$', isser_method_name: '^(?:is|has|should|may|supports)' } }
unreachable_code: { enabled: false }
check_access_control: { enabled: false }
typo_checks: { enabled: false }
check_variables: { enabled: false }
check_calls: { enabled: true, too_many_arguments: true, missing_argument: true, argument_type_checks: lenient }
dead_assignments: { enabled: false }
check_usage_context: { enabled: true, foreach: { value_as_reference: true, traversable: true } }
reflection_checks: { enabled: false }
precedence_checks: { enabled: true, assignment_in_condition: true, comparison_of_bit_result: true }
basic_semantic_checks: { enabled: false }
unused_code: { enabled: false }
deprecation_checks: { enabled: false }
useless_function_calls: { enabled: false }
metrics_lack_of_cohesion_methods: { enabled: false }
metrics_coupling: { enabled: true, stable_code: { namespace_prefixes: { }, classes: { } } }
doctrine_parameter_binding: { enabled: false }
doctrine_entity_manager_injection: { enabled: false }
symfony_request_injection: { enabled: false }
doc_comment_fixes: { enabled: false }
php_code_sniffer:
config:
standard: WordPress
sniffs: { wordpress: { arrays: { array_declaration_sniff: true }, classes: { valid_class_name_sniff: true }, files: { file_name_sniff: true }, formatting: { multiple_statement_alignment_sniff: true }, functions: { function_call_signature_sniff: true, function_declaration_argument_spacing_sniff: true }, naming_conventions: { valid_function_name_sniff: true }, objects: { object_instantiation_sniff: true }, php: { discouraged_functions_sniff: true }, strings: { double_quote_usage_sniff: true }, white_space: { control_structure_spacing_sniff: true, operator_spacing_sniff: true, php_indent_sniff: true }, xss: { escape_output_sniff: true } } }
php_loc: true
php_pdepend: true
php_sim: true
php_changetracking: true

View file

@ -1,61 +0,0 @@
language: php
sudo: false
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
env:
# - WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=5.0 WP_MULTISITE=0
- WP_VERSION=4.9 WP_MULTISITE=0
- WP_VERSION=4.8 WP_MULTISITE=0
- WP_VERSION=4.7 WP_MULTISITE=0
- WP_VERSION=4.6 WP_MULTISITE=0
- WP_VERSION=4.5 WP_MULTISITE=0
matrix:
include:
- php: 5.3
dist: precise
env: WP_VERSION=5.0 WP_MULTISITE=0
- php: 5.3
dist: precise
env: WP_VERSION=4.9 WP_MULTISITE=0
- php: 5.3
dist: precise
env: WP_VERSION=4.8 WP_MULTISITE=0
- php: 5.3
dist: precise
env: WP_VERSION=4.7 WP_MULTISITE=0
- php: 5.3
dist: precise
env: WP_VERSION=4.6 WP_MULTISITE=0
- php: 5.3
dist: precise
env: WP_VERSION=4.5 WP_MULTISITE=0
- php: 5.3
dist: precise
env: WP_VERSION=5.0 WP_MULTISITE=1
- php: 5.3
dist: precise
env: WP_VERSION=4.9 WP_MULTISITE=1
before_install:
- composer self-update
before_script:
- mysql -e "create database IF NOT EXISTS carbon_fields_tests;" -uroot
- bash tests/bin/install.sh carbon_fields_tests root '' localhost $WP_VERSION
script: ./vendor/bin/phpunit --coverage-clover=./tmp/clover.xml
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover ./tmp/clover.xml

0
web/vendor/htmlburger/carbon-fields/CONTRIBUTING.md vendored Executable file → Normal file
View file

View file

@ -1,22 +0,0 @@
# Release Guide
## `htmlburger/carbon-fields`
1. Bump version numbers in `config.php` and `package.json` according to SemVer
1. Commit to `development` with commit message "Bump vX.X.X"
1. Merge all changes for the new version into `master`
1. Checkout `master`
1. Run `npm install && npm run build`
1. `git push origin master`
1. Create a new release in [Github](https://github.com/htmlburger/carbon-fields/releases/new) from the `master` branch
1. Enter the new version you set in `config.php` for `Tag version` and `Title`
1. Add a changelog for `Description`
1. Click `Publish release`
## `htmlburger/carbon-fields-plugin`
1. Update the version in `carbon-fields-plugin.php`, `readme.txt` and `composer.json` for `htmlburger/carbon-fields` to match the newly released version
1. Commit to `master`
1. Create a new release in [Github](https://github.com/htmlburger/carbon-fields-plugin/releases/new) from the `master` branch
1. Enter the new version for `Tag version` and `Title` (you can skip the changelog)
1. Click `Publish release`

0
web/vendor/htmlburger/carbon-fields/ISSUE_TEMPLATE.md vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/README.md vendored Executable file → Normal file
View file

View file

@ -1,81 +0,0 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box_check_update = false
config.vm.network "forwarded_port", guest: 80, host: 8080
# Fix the DNS resolution speed. This actually slows down the unit tests speed
# (I assume due to base WP test suite)
# See http://serverfault.com/a/496612/80479
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.synced_folder ".", "/home/vagrant/carbon-fields"
config.vm.synced_folder "../../../", "/var/www/"
# Install some software on the machine and setup unit tests environment
config.vm.provision "shell", inline: <<-SHELL
DBHOST=localhost
DBNAME=wp
DBUSER=wp
DBPASSWD=secret
echo -e "\n--- Update apt ---\n"
sudo apt-get -qq update
echo -e "\n--- Install some base packages ---\n"
sudo apt-get -y install vim curl build-essential python-software-properties nginx git subversion zip > /dev/null 2>&1
echo -e "\n--- Install PHP7 ---\n"
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get -qq update
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y
echo -e "\n--- Install composer ---\n"
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
echo -e "\n--- Install phpUnit ---\n"
su - vagrant -c 'sudo composer global require "phpunit/phpunit=5.0.*"'
echo 'PATH=$PATH:~/.composer/vendor/bin/' >> ~vagrant/.bash_profile && chown vagrant:vagrant ~vagrant/.bash_profile
echo -e "\n--- Install MySQL ---\n"
echo "mysql-server mysql-server/root_password password $DBPASSWD" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password $DBPASSWD" | debconf-set-selections
sudo apt-get -y install mysql-server-5.5
echo 'server {
listen 80;
server_name localhost;
root /var/www/;
index index.php index.html;
# Important for VirtualBox
sendfile off;
location / {
try_files $uri $uri/ =404;
}
location ~* \.php {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_cache off;
fastcgi_index index.php;
}
}' > /etc/nginx/sites-available/default
service nginx restart;
echo -e "\n--- Setup MySQL ---\n"
mysql -uroot -p$DBPASSWD -e "CREATE DATABASE $DBNAME"
mysql -uroot -p$DBPASSWD -e "grant all privileges on $DBNAME.* to '$DBUSER'@'localhost' identified by '$DBPASSWD'"
su - vagrant -c "cd /home/vagrant/carbon-fields && ./tests/bin/install.sh $DBNAME $DBUSER $DBPASSWD"
SHELL
end

2
web/vendor/htmlburger/carbon-fields/assets/styles/_colors.scss vendored Executable file → Normal file
View file

@ -32,4 +32,4 @@ $gb-dark-gray-150: #8d96a0;
$gb-light-gray-500: #e2e4e7;
$gb-light-gray-200: #f3f4f5;
$gb-dark-opacity-light-500: rgba(#9197a2, 0.25);
$gb-dark-opacity-light-200: rgba(#8b8b96, 0.1);
$gb-dark-opacity-light-200: rgba(#8b8b96, .1);

2
web/vendor/htmlburger/carbon-fields/assets/styles/_fonts.scss vendored Executable file → Normal file
View file

@ -2,6 +2,6 @@
Fonts
========================================================================== */
$wp-font: -apple-system, blinkmacsystemfont,"Segoe UI", roboto, oxygen-sans, ubuntu, cantarell,"Helvetica Neue", sans-serif;
$wp-font: -apple-system, BlinkMacSystemFont,"Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,"Helvetica Neue", sans-serif;
$wp-font-size: 13px;
$wp-line-height: 1.4;

2
web/vendor/htmlburger/carbon-fields/assets/styles/_variables.scss vendored Executable file → Normal file
View file

@ -2,7 +2,7 @@
Variables
========================================================================== */
$transition-base: 0.1s linear;
$transition-base: .1s linear;
$size-base: 4px;
/* ==========================================================================

0
web/vendor/htmlburger/carbon-fields/bin/paths.js vendored Executable file → Normal file
View file

1
web/vendor/htmlburger/carbon-fields/bin/webpack.base.js vendored Executable file → Normal file
View file

@ -69,7 +69,6 @@ module.exports = {
}
} ),
new TerserPlugin( {
cache: true,
parallel: true
} )
]

0
web/vendor/htmlburger/carbon-fields/bin/webpack.blocks.js vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/bin/webpack.core.js vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/bin/webpack.metaboxes.js vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/bin/webpack.vendor.js vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/bin/wp-packages.js vendored Executable file → Normal file
View file

1068
web/vendor/htmlburger/carbon-fields/build/classic/core.css vendored Executable file → Normal file

File diff suppressed because it is too large Load diff

108
web/vendor/htmlburger/carbon-fields/build/classic/core.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

987
web/vendor/htmlburger/carbon-fields/build/classic/core.min.css vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

2
web/vendor/htmlburger/carbon-fields/build/classic/core.min.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

179
web/vendor/htmlburger/carbon-fields/build/classic/metaboxes.css vendored Executable file → Normal file
View file

@ -1,112 +1,94 @@
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Complex
========================================================================== */
.postbox .cf-complex__inserter-menu, body[class*="taxonomy-"] .cf-complex__inserter-menu {
.postbox .cf-complex__inserter-menu, body[class*=taxonomy-] .cf-complex__inserter-menu {
margin: 0;
background-color: #191e23;
border-radius: 3px;
background-color: #191e23;
}
.postbox .cf-complex__inserter-menu::before, body[class*="taxonomy-"] .cf-complex__inserter-menu::before {
content: "";
.postbox .cf-complex__inserter-menu:before, body[class*=taxonomy-] .cf-complex__inserter-menu:before {
position: absolute;
top: 50%;
right: 100%;
width: 0;
height: 0;
margin-top: -5px;
border-color: transparent #191e23;
border-style: solid;
border-width: 5px 5px 5px 0;
border-style: solid;
border-color: transparent #191e23;
margin-top: -5px;
content: "";
}
.postbox .cf-complex__inserter-item, body[class*="taxonomy-"] .cf-complex__inserter-item {
.postbox .cf-complex__inserter-item, body[class*=taxonomy-] .cf-complex__inserter-item {
font-weight: 600;
color: #fff;
transition: color 0.1s linear;
}
.postbox .cf-complex__inserter-item:hover, body[class*="taxonomy-"] .cf-complex__inserter-item:hover {
.postbox .cf-complex__inserter-item:hover, body[class*=taxonomy-] .cf-complex__inserter-item:hover {
color: #00a0d2;
}
.postbox .cf-complex__tabs .cf-complex__inserter-button, body[class*="taxonomy-"] .cf-complex__tabs .cf-complex__inserter-button {
.postbox .cf-complex__tabs .cf-complex__inserter-button, body[class*=taxonomy-] .cf-complex__tabs .cf-complex__inserter-button {
font-weight: 600;
color: #23282d;
}
.postbox .cf-complex__tabs-item, body[class*="taxonomy"] .cf-complex__tabs-item {
.postbox .cf-complex__tabs-item, body[class*=taxonomy] .cf-complex__tabs-item {
font-weight: 600;
color: #23282d;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Field
========================================================================== */
.cf-container .cf-field {
flex: 1 1 100%;
padding: 12px;
border-color: #e2e4e7;
border-style: solid;
border-width: 0 1px 0 0;
border-style: solid;
border-color: #e2e4e7;
}
.cf-container .cf-field + .cf-field {
border-top-width: 1px;
}
@ -122,85 +104,67 @@
font-weight: 600;
color: #23282d;
}
.cf-container-term-meta .cf-field__label, .cf-container-user-meta .cf-field__label {
margin: 0 !important;
}
.cf-field__help {
display: inline-block;
margin-top: 10px;
color: #666;
margin-top: 10px;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Multiselect
========================================================================== */
.postbox .cf-multiselect__control {
border-color: #ddd;
box-shadow: 0 1px 2px rgb(0 0 0 / 7%) inset;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
}
.postbox .cf-multiselect__control--is-focused, .postbox .cf-multiselect__control--is-focused:hover {
box-shadow: 0 0 2px rgb(0 115 170 / 80%);
box-shadow: 0 0 2px rgba(0, 115, 170, 0.8);
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Media Gallery
========================================================================== */
@ -211,14 +175,13 @@
.postbox .cf-media-gallery__actions {
border-top: 1px solid #e2e4e7;
}
.cf-container-term-meta .cf-media-gallery__actions {
padding-left: 0;
}
.cf-container-term-meta .cf-media-gallery__list {
max-height: 285px;
margin: 0 -8px;
max-height: 285px;
}
.cf-container-term-meta .cf-media-gallery__item {
@ -234,140 +197,110 @@
}
.postbox .cf-media-gallery__item-name, .cf-container-term-meta .cf-media-gallery__item-name {
background-color: #f3f4f5;
border-top: 1px solid #e2e4e7;
background-color: #f3f4f5;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Radio
========================================================================== */
.inside .cf-radio-image .cf-radio__input:focus ~ .cf-radio__label {
box-shadow: 0 0 2px rgb(0 160 210 / 80%);
box-shadow: 0 0 2px rgba(0, 160, 210, 0.8);
}
.inside .cf-radio-image__image {
border: 1px solid #b5bcc2;
}
.inside .cf-radio__input:focus ~ .cf-radio__label .cf-radio-image__image, .inside .cf-radio__input:checked ~ .cf-radio__label .cf-radio-image__image {
outline: 4px solid #00a0d2;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Widget
========================================================================== */
.cf-container-widget {
margin-bottom: 13px;
}
.cf-container-widget .cf-field {
margin: 1em 0 0;
padding: 0;
border-width: 0;
}
.cf-container-widget .cf-field + .cf-field {
border-top-width: 0;
}
.cf-container-widget .cf-complex__group-body {
border-width: 1px 1px 1px 1px;
margin-top: 0;
border-width: 1px;
}
.cf-container-widget .cf-complex__group-body .cf-field {
padding: 12px;
}
.cf-container-widget .cf-complex__group-body .cf-field + .cf-field {
border-width: 1px 0 0 0;
padding-top: 1em;
border-width: 1px 0 0;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Theme Options
========================================================================== */
@ -376,70 +309,54 @@
right: 0;
margin-right: 20px;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
User Meta
========================================================================== */
.cf-container-user-meta {
max-width: 600px;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Container
========================================================================== */
@ -449,47 +366,41 @@
#poststuff .carbon-box .inside,
.carbon-box .inside {
margin: 0;
padding: 0;
margin: 0;
}
.cf-container--plain {
display: block;
}
.cf-container--tabbed {
display: flex;
}
.cf-container--tabbed-horizontal {
flex-direction: column;
}
.cf-container--tabbed-vertical {
flex-direction: row;
}
.cf-container__fields {
display: flex;
flex: 1;
flex-wrap: wrap;
flex: 1;
margin: 0 -1px 0 0;
background-color: #fff;
}
.cf-container__fields[hidden] {
display: none;
}
.block-editor .cf-container__fields {
border-left: 1px solid #e2e4e7;
}
.cf-container-term-meta .cf-container__fields, .cf-container-user-meta .cf-container__fields {
margin: 0;
border-color: #e2e4e7;
border-style: solid;
border-width: 0 0 1px 1px;
border-style: solid;
border-color: #e2e4e7;
margin: 0;
}
.cf-container__tabs {
@ -497,85 +408,71 @@
z-index: 1;
background-color: #fbfbfc;
}
.cf-container__tabs-list {
display: flex;
flex-wrap: wrap;
margin: 0 0 -1px;
}
.cf-container__tabs-list .cf-container__tabs-item {
cursor: pointer;
display: flex;
align-items: center;
margin: 0 8px 0 0;
font-size: 13px;
background-color: #fbfbfc;
border: 1px solid #e2e4e7;
margin: 0 8px 0 0;
background-color: #fbfbfc;
font-size: 13px;
cursor: pointer;
transition: background-color 0.1s linear, border-color 0.1s linear;
}
.cf-container__tabs-list .cf-container__tabs-item button {
cursor: pointer;
display: flex;
flex: 1;
align-items: center;
margin: 0;
padding: 10px 12px;
background: 0;
border: 0;
padding: 10px 12px;
margin: 0;
flex: 1;
cursor: pointer;
display: flex;
align-items: center;
}
.cf-container__tabs-list .cf-container__tabs-item button span {
margin-right: 5px;
}
.cf-container__tabs-list .cf-container__tabs-item:hover {
background-color: #fff;
}
.cf-container__tabs-list .cf-container__tabs-item--current {
background-color: #fff;
border-bottom-color: #fff;
}
.cf-container__tabs--tabbed-horizontal {
padding: 12px 12px 0;
border-bottom: 1px solid #e2e4e7;
}
.cf-container__tabs--tabbed-horizontal .cf-container__tabs-list {
display: flex;
flex-direction: row;
}
.cf-container__tabs--tabbed-vertical {
width: 300px;
border-right: 1px solid #e2e4e7;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list {
display: flex;
flex-direction: column;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item {
justify-content: flex-start;
margin: 0;
justify-content: flex-start;
border: 0;
border-top: 1px solid #e2e4e7;
border-bottom: 1px solid #e2e4e7;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item:first-of-type {
border-top: 0;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item button {
font-weight: 500;
text-align: left;
font-weight: 500;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item + .cf-container__tabs-item {
border-top: 0;
}

303
web/vendor/htmlburger/carbon-fields/build/classic/metaboxes.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

126
web/vendor/htmlburger/carbon-fields/build/classic/metaboxes.min.css vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

2
web/vendor/htmlburger/carbon-fields/build/classic/metaboxes.min.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

68
web/vendor/htmlburger/carbon-fields/build/classic/vendor.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

57
web/vendor/htmlburger/carbon-fields/build/classic/vendor.min.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

241
web/vendor/htmlburger/carbon-fields/build/gutenberg/blocks.css vendored Executable file → Normal file
View file

@ -1,47 +1,38 @@
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Association
========================================================================== */
.block-editor .cf-association__cols {
margin-top: 4px;
border-top-width: 1px;
margin-top: 4px;
}
.edit-post-sidebar .cf-association__cols {
flex-direction: column;
border-color: #8d96a0;
flex-direction: column;
}
.edit-post-sidebar .cf-association__cols::before {
display: none;
background-color: #8d96a0;
display: none;
}
.edit-post-sidebar .cf-association__counter {
@ -51,7 +42,6 @@
.edit-post-sidebar .cf-association__option {
height: 40px;
}
.edit-post-sidebar .cf-association__option + .cf-association__option {
border-top-color: #8d96a0;
}
@ -61,8 +51,8 @@
}
.edit-post-sidebar .cf-association__option-content {
flex-direction: column;
align-items: flex-start;
flex-direction: column;
min-width: 0;
}
@ -73,7 +63,6 @@
.edit-post-sidebar .cf-association__col:first-child .cf-association__option-actions {
min-width: 0;
}
.edit-post-sidebar .cf-association__option-actions {
margin-left: auto;
}
@ -81,35 +70,27 @@
.edit-post-sidebar .cf-association__option-action--edit {
display: none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Complex
========================================================================== */
@ -121,28 +102,25 @@
.block-editor .cf-complex__inserter-menu {
z-index: 10;
list-style: none outside none;
background-color: #fff;
border: 1px solid #e2e4e7;
box-shadow: 0 3px 30px rgb(25 30 35 / 10%);
box-shadow: 0 3px 30px rgba(25, 30, 35, 0.1);
background-color: #fff;
}
.block-editor .cf-complex__inserter-menu::before, .block-editor .cf-complex__inserter-menu::after {
content: "";
position: absolute;
top: 50%;
right: 100%;
width: 0;
height: 0;
margin-top: -8px;
border-style: solid;
border-width: 8px 8px 8px 0;
border-style: solid;
margin-top: -8px;
content: "";
}
.block-editor .cf-complex__inserter-menu::before {
margin-right: 1px;
border-color: transparent #e2e4e7;
margin-right: 1px;
}
.block-editor .cf-complex__inserter-menu::after {
border-color: transparent #fff;
}
@ -150,7 +128,6 @@
.block-editor .cf-complex__inserter-item {
color: #40464d;
}
.block-editor .cf-complex__inserter-item:hover {
color: #191e23;
}
@ -162,11 +139,9 @@
.block-editor .cf-complex__tabs-item {
color: #555d66;
}
.block-editor .cf-complex__tabs-item--current {
color: #191e23;
}
.edit-post-sidebar .cf-complex__tabs-item {
border-color: #8d96a0;
}
@ -183,61 +158,49 @@
.edit-post-sidebar .cf-complex__group-actions--tabbed {
border-color: #8d96a0;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Field
========================================================================== */
.block-editor .cf-field {
min-width: 0;
padding: 8px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
line-height: 1.4;
color: #555d66;
padding: 8px;
min-width: 0;
}
.wp-block-widget-area .cf-field {
padding: 6.5px 20px;
}
.edit-post-sidebar .cf-block__fields > .cf-field {
padding: 4px 0 0;
}
.block-editor .cf-complex .cf-field {
border-color: #e2e4e7;
border-style: solid;
border-width: 1px 1px 0 0;
border-style: solid;
border-color: #e2e4e7;
}
.edit-post-sidebar .cf-complex .cf-field {
border-color: #8d96a0;
}
@ -247,50 +210,39 @@
font-weight: 600;
color: #23282d;
}
.block-editor .cf-field__label {
margin-bottom: 4px;
}
.wp-block-widget-area .cf-field__label {
margin-bottom: 6.5px;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
DateTime
========================================================================== */
.edit-post-sidebar .cf-datetime__inner {
position: relative;
}
.edit-post-sidebar .cf-datetime__inner::before {
position: absolute;
top: 50%;
@ -304,11 +256,9 @@
border-color: #e2e4e7;
border-radius: 0;
}
.wp-block .cf-field .cf-datetime__input:focus {
box-shadow: none;
}
.edit-post-sidebar .cf-field .cf-datetime__input {
padding-left: 35px;
}
@ -317,39 +267,30 @@
height: auto;
border-color: #e2e4e7;
}
.edit-post-sidebar .cf-datetime__button {
display: none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
File
========================================================================== */
@ -364,139 +305,106 @@
.edit-post-sidebar .cf-file__name {
border-color: #8d96a0;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Map
========================================================================== */
.edit-post-sidebar .cf-map__canvas {
margin-top: 4px;
border-color: #8d96a0;
border-top-width: 1px;
margin-top: 4px;
}
.block-editor .cf-map__search[focus-within] ~ .cf-map__canvas {
border-color: #00a0d2;
}
.block-editor .cf-map__search:focus-within ~ .cf-map__canvas {
border-color: #00a0d2;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Multiselect
========================================================================== */
.wp-block .cf-multiselect__control {
border-radius: 0;
}
.edit-post-sidebar .cf-multiselect__control, .edit-post-sidebar .cf-multiselect__control:hover {
border-color: #8d96a0;
}
.edit-post-sidebar .cf-multiselect__control--is-focused, .edit-post-sidebar .cf-multiselect__control--is-focused:hover {
border-color: #00a0d2;
box-shadow: 0 0 0 1px #00a0d2;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Media Gallery
========================================================================== */
@media (width >= 1440px) {
@media (min-width: 1440px) {
.block-editor .cf-media-gallery__item {
flex-basis: 16.6667%;
}
}
@media (width >= 1680px) {
@media (min-width: 1680px) {
.block-editor .cf-media-gallery__item {
flex-basis: 16.6667%;
}
}
.edit-post-sidebar .cf-media-gallery__item {
flex-basis: 50%;
}
@ -504,7 +412,6 @@
.wp-block .cf-media-gallery__inner {
border: 1px solid #e2e4e7;
}
.edit-post-sidebar .cf-media-gallery__inner {
border: 1px solid #8d96a0;
}
@ -512,7 +419,6 @@
.wp-block .cf-media-gallery__actions {
border-top: 1px solid #e2e4e7;
}
.edit-post-sidebar .cf-media-gallery__actions {
border-top: 1px solid #8d96a0;
}
@ -520,7 +426,6 @@
.wp-block .cf-media-gallery__item-inner {
border: 1px solid #e2e4e7;
}
.edit-post-sidebar .cf-media-gallery__item-inner {
border: 1px solid #8d96a0;
}
@ -532,142 +437,108 @@
.block-editor .cf-media-gallery__item-name {
background-color: #f3f4f5;
}
.wp-block .cf-media-gallery__item-name {
border-top: 1px solid #e2e4e7;
}
.edit-post-sidebar .cf-media-gallery__item-name {
border-top: 1px solid #8d96a0;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
oEmbed
========================================================================== */
.edit-post-sidebar .cf-oembed__preview {
margin-top: 4px;
border-color: #8d96a0;
border-top-width: 1px;
margin-top: 4px;
}
.block-editor .cf-oembed[focus-within] .cf-oembed__preview {
border-color: #00a0d2;
}
.block-editor .cf-oembed:focus-within .cf-oembed__preview {
border-color: #00a0d2;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Radio
========================================================================== */
.wp-block .cf-radio__list {
list-style: none outside none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Radio Image
========================================================================== */
.block-editor .cf-radio__list-item {
margin: 0;
}
@media (width >= 1440px) {
@media (min-width: 1440px) {
.wp-block .cf-radio-image .cf-radio__list-item {
flex-basis: 25%;
}
}
@media (width >= 1680px) {
@media (min-width: 1680px) {
.wp-block .cf-radio-image .cf-radio__list-item {
flex-basis: 25%;
}
}
.edit-post-sidebar .cf-radio-image .cf-radio__list-item {
flex-basis: 33.3333%;
}
@ -675,43 +546,33 @@
.wp-block .cf-radio-image__image {
border: 1px solid #e2e4e7;
}
.edit-post-sidebar .cf-radio-image__image {
border: 1px solid #8d96a0;
}
.block-editor .cf-radio__input:focus ~ .cf-radio__label .cf-radio-image__image, .block-editor .cf-radio__input:checked ~ .cf-radio__label .cf-radio-image__image {
outline: 2px solid #00a0d2;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Select
========================================================================== */
@ -719,109 +580,84 @@
border-color: #e2e4e7;
border-radius: 0;
}
.wp-block .cf-field .cf-select__input:focus {
box-shadow: none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Set
========================================================================== */
.wp-block .cf-set__list {
list-style: none outside none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Separator
========================================================================== */
.block-editor .cf-separator h3 {
margin: 0;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Text
========================================================================== */
@ -829,39 +665,30 @@
border-color: #e2e4e7;
border-radius: 0;
}
.wp-block .cf-field .cf-text__input:focus {
box-shadow: none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Textarea
========================================================================== */
@ -870,83 +697,64 @@
border-radius: 0;
transition: border-color 0.1s linear;
}
.wp-block .cf-field .cf-textarea__input:focus {
border-color: #00a0d2;
box-shadow: none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ------------------------------------------------------------ *\
Block Preview iFrame
\* ------------------------------------------------------------ */
body.block-editor-iframe__body .cf-block-preview {
display: block;
}
body.block-editor-iframe__body .cf-block__fields[\:has\(.cf-block-preview\)] .cf-field:not(.cf-block-preview) {
display: none;
}
body.block-editor-iframe__body .cf-block__fields:has(.cf-block-preview) .cf-field:not(.cf-block-preview) {
display: none;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Block
========================================================================== */
@ -956,20 +764,19 @@ body.block-editor-iframe__body .cf-block__fields:has(.cf-block-preview) .cf-fiel
.wp-block .cf-block__tabs-list {
display: flex;
margin: 0;
padding: 0;
margin: 0;
list-style: none outside none;
}
.cf-block__tabs-item {
cursor: pointer;
margin: 0;
padding: 8px;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
line-height: 1;
cursor: pointer;
}
.cf-block__tabs-item--current {
box-shadow: 0 3px 0 #00a0d2;
}
@ -978,11 +785,9 @@ body.block-editor-iframe__body .cf-block__fields:has(.cf-block-preview) .cf-fiel
display: flex;
flex-wrap: wrap;
}
.cf-block__fields[hidden] {
display: none;
}
.wp-block .cf-block__fields {
margin: -8px;
}

183
web/vendor/htmlburger/carbon-fields/build/gutenberg/blocks.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

116
web/vendor/htmlburger/carbon-fields/build/gutenberg/blocks.min.css vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

2
web/vendor/htmlburger/carbon-fields/build/gutenberg/blocks.min.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

View file

1068
web/vendor/htmlburger/carbon-fields/build/gutenberg/core.css vendored Executable file → Normal file

File diff suppressed because it is too large Load diff

108
web/vendor/htmlburger/carbon-fields/build/gutenberg/core.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

987
web/vendor/htmlburger/carbon-fields/build/gutenberg/core.min.css vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

2
web/vendor/htmlburger/carbon-fields/build/gutenberg/core.min.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

179
web/vendor/htmlburger/carbon-fields/build/gutenberg/metaboxes.css vendored Executable file → Normal file
View file

@ -1,112 +1,94 @@
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Complex
========================================================================== */
.postbox .cf-complex__inserter-menu, body[class*="taxonomy-"] .cf-complex__inserter-menu {
.postbox .cf-complex__inserter-menu, body[class*=taxonomy-] .cf-complex__inserter-menu {
margin: 0;
background-color: #191e23;
border-radius: 3px;
background-color: #191e23;
}
.postbox .cf-complex__inserter-menu::before, body[class*="taxonomy-"] .cf-complex__inserter-menu::before {
content: "";
.postbox .cf-complex__inserter-menu:before, body[class*=taxonomy-] .cf-complex__inserter-menu:before {
position: absolute;
top: 50%;
right: 100%;
width: 0;
height: 0;
margin-top: -5px;
border-color: transparent #191e23;
border-style: solid;
border-width: 5px 5px 5px 0;
border-style: solid;
border-color: transparent #191e23;
margin-top: -5px;
content: "";
}
.postbox .cf-complex__inserter-item, body[class*="taxonomy-"] .cf-complex__inserter-item {
.postbox .cf-complex__inserter-item, body[class*=taxonomy-] .cf-complex__inserter-item {
font-weight: 600;
color: #fff;
transition: color 0.1s linear;
}
.postbox .cf-complex__inserter-item:hover, body[class*="taxonomy-"] .cf-complex__inserter-item:hover {
.postbox .cf-complex__inserter-item:hover, body[class*=taxonomy-] .cf-complex__inserter-item:hover {
color: #00a0d2;
}
.postbox .cf-complex__tabs .cf-complex__inserter-button, body[class*="taxonomy-"] .cf-complex__tabs .cf-complex__inserter-button {
.postbox .cf-complex__tabs .cf-complex__inserter-button, body[class*=taxonomy-] .cf-complex__tabs .cf-complex__inserter-button {
font-weight: 600;
color: #23282d;
}
.postbox .cf-complex__tabs-item, body[class*="taxonomy"] .cf-complex__tabs-item {
.postbox .cf-complex__tabs-item, body[class*=taxonomy] .cf-complex__tabs-item {
font-weight: 600;
color: #23282d;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Field
========================================================================== */
.cf-container .cf-field {
flex: 1 1 100%;
padding: 12px;
border-color: #e2e4e7;
border-style: solid;
border-width: 0 1px 0 0;
border-style: solid;
border-color: #e2e4e7;
}
.cf-container .cf-field + .cf-field {
border-top-width: 1px;
}
@ -122,85 +104,67 @@
font-weight: 600;
color: #23282d;
}
.cf-container-term-meta .cf-field__label, .cf-container-user-meta .cf-field__label {
margin: 0 !important;
}
.cf-field__help {
display: inline-block;
margin-top: 10px;
color: #666;
margin-top: 10px;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Multiselect
========================================================================== */
.postbox .cf-multiselect__control {
border-color: #ddd;
box-shadow: 0 1px 2px rgb(0 0 0 / 7%) inset;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
}
.postbox .cf-multiselect__control--is-focused, .postbox .cf-multiselect__control--is-focused:hover {
box-shadow: 0 0 2px rgb(0 115 170 / 80%);
box-shadow: 0 0 2px rgba(0, 115, 170, 0.8);
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Media Gallery
========================================================================== */
@ -211,14 +175,13 @@
.postbox .cf-media-gallery__actions {
border-top: 1px solid #e2e4e7;
}
.cf-container-term-meta .cf-media-gallery__actions {
padding-left: 0;
}
.cf-container-term-meta .cf-media-gallery__list {
max-height: 285px;
margin: 0 -8px;
max-height: 285px;
}
.cf-container-term-meta .cf-media-gallery__item {
@ -234,140 +197,110 @@
}
.postbox .cf-media-gallery__item-name, .cf-container-term-meta .cf-media-gallery__item-name {
background-color: #f3f4f5;
border-top: 1px solid #e2e4e7;
background-color: #f3f4f5;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Radio
========================================================================== */
.inside .cf-radio-image .cf-radio__input:focus ~ .cf-radio__label {
box-shadow: 0 0 2px rgb(0 160 210 / 80%);
box-shadow: 0 0 2px rgba(0, 160, 210, 0.8);
}
.inside .cf-radio-image__image {
border: 1px solid #b5bcc2;
}
.inside .cf-radio__input:focus ~ .cf-radio__label .cf-radio-image__image, .inside .cf-radio__input:checked ~ .cf-radio__label .cf-radio-image__image {
outline: 4px solid #00a0d2;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Widget
========================================================================== */
.cf-container-widget {
margin-bottom: 13px;
}
.cf-container-widget .cf-field {
margin: 1em 0 0;
padding: 0;
border-width: 0;
}
.cf-container-widget .cf-field + .cf-field {
border-top-width: 0;
}
.cf-container-widget .cf-complex__group-body {
border-width: 1px 1px 1px 1px;
margin-top: 0;
border-width: 1px;
}
.cf-container-widget .cf-complex__group-body .cf-field {
padding: 12px;
}
.cf-container-widget .cf-complex__group-body .cf-field + .cf-field {
border-width: 1px 0 0 0;
padding-top: 1em;
border-width: 1px 0 0;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Theme Options
========================================================================== */
@ -376,70 +309,54 @@
right: 0;
margin-right: 20px;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
User Meta
========================================================================== */
.cf-container-user-meta {
max-width: 600px;
}
/* ==========================================================================
Colors
========================================================================== */
/* ==========================================================================
WordPress Colors - https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
========================================================================== */
/* ==========================================================================
Gutenberg Colors - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_colors.scss
========================================================================== */
/* ==========================================================================
Fonts
========================================================================== */
/* ==========================================================================
Variables
========================================================================== */
/* ==========================================================================
WordPress Variables
========================================================================== */
/* ==========================================================================
Gutenberg Variables - https://github.com/WordPress/gutenberg/blob/master/assets/stylesheets/_variables.scss
========================================================================== */
/* ==========================================================================
Container
========================================================================== */
@ -449,47 +366,41 @@
#poststuff .carbon-box .inside,
.carbon-box .inside {
margin: 0;
padding: 0;
margin: 0;
}
.cf-container--plain {
display: block;
}
.cf-container--tabbed {
display: flex;
}
.cf-container--tabbed-horizontal {
flex-direction: column;
}
.cf-container--tabbed-vertical {
flex-direction: row;
}
.cf-container__fields {
display: flex;
flex: 1;
flex-wrap: wrap;
flex: 1;
margin: 0 -1px 0 0;
background-color: #fff;
}
.cf-container__fields[hidden] {
display: none;
}
.block-editor .cf-container__fields {
border-left: 1px solid #e2e4e7;
}
.cf-container-term-meta .cf-container__fields, .cf-container-user-meta .cf-container__fields {
margin: 0;
border-color: #e2e4e7;
border-style: solid;
border-width: 0 0 1px 1px;
border-style: solid;
border-color: #e2e4e7;
margin: 0;
}
.cf-container__tabs {
@ -497,85 +408,71 @@
z-index: 1;
background-color: #fbfbfc;
}
.cf-container__tabs-list {
display: flex;
flex-wrap: wrap;
margin: 0 0 -1px;
}
.cf-container__tabs-list .cf-container__tabs-item {
cursor: pointer;
display: flex;
align-items: center;
margin: 0 8px 0 0;
font-size: 13px;
background-color: #fbfbfc;
border: 1px solid #e2e4e7;
margin: 0 8px 0 0;
background-color: #fbfbfc;
font-size: 13px;
cursor: pointer;
transition: background-color 0.1s linear, border-color 0.1s linear;
}
.cf-container__tabs-list .cf-container__tabs-item button {
cursor: pointer;
display: flex;
flex: 1;
align-items: center;
margin: 0;
padding: 10px 12px;
background: 0;
border: 0;
padding: 10px 12px;
margin: 0;
flex: 1;
cursor: pointer;
display: flex;
align-items: center;
}
.cf-container__tabs-list .cf-container__tabs-item button span {
margin-right: 5px;
}
.cf-container__tabs-list .cf-container__tabs-item:hover {
background-color: #fff;
}
.cf-container__tabs-list .cf-container__tabs-item--current {
background-color: #fff;
border-bottom-color: #fff;
}
.cf-container__tabs--tabbed-horizontal {
padding: 12px 12px 0;
border-bottom: 1px solid #e2e4e7;
}
.cf-container__tabs--tabbed-horizontal .cf-container__tabs-list {
display: flex;
flex-direction: row;
}
.cf-container__tabs--tabbed-vertical {
width: 300px;
border-right: 1px solid #e2e4e7;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list {
display: flex;
flex-direction: column;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item {
justify-content: flex-start;
margin: 0;
justify-content: flex-start;
border: 0;
border-top: 1px solid #e2e4e7;
border-bottom: 1px solid #e2e4e7;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item:first-of-type {
border-top: 0;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item button {
font-weight: 500;
text-align: left;
font-weight: 500;
}
.cf-container__tabs--tabbed-vertical .cf-container__tabs-list .cf-container__tabs-item + .cf-container__tabs-item {
border-top: 0;
}

303
web/vendor/htmlburger/carbon-fields/build/gutenberg/metaboxes.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

126
web/vendor/htmlburger/carbon-fields/build/gutenberg/metaboxes.min.css vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

68
web/vendor/htmlburger/carbon-fields/build/gutenberg/vendor.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

2
web/vendor/htmlburger/carbon-fields/build/gutenberg/vendor.min.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

View file

0
web/vendor/htmlburger/carbon-fields/composer.json vendored Executable file → Normal file
View file

2
web/vendor/htmlburger/carbon-fields/config.php vendored Executable file → Normal file
View file

@ -4,7 +4,7 @@ namespace Carbon_Fields;
# Define version constant
if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
define( __NAMESPACE__ . '\VERSION', '3.6.5' );
define( __NAMESPACE__ . '\VERSION', '3.6.6' );
}
# Define root directory

0
web/vendor/htmlburger/carbon-fields/core/Block.php vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/core/Carbon_Fields.php vendored Executable file → Normal file
View file

0
web/vendor/htmlburger/carbon-fields/core/Container.php vendored Executable file → Normal file
View file

View file

@ -438,21 +438,20 @@ class Block_Container extends Container {
*
* @param array $attributes
* @param string $content
* @param \WP_Block $block
* @return string
*/
public function render_block( $attributes, $content ) {
public function render_block( $attributes, $content, $block = null ) { // added variable at the end
$fields = $attributes['data'];
$post_id = $this->get_post_id();
// Unset the "data" property because we
// pass it as separate argument to the callback.
unset($attributes['data']);
ob_start();
call_user_func( $this->render_callback , $fields, $attributes, $content, $post_id );
return ob_get_clean();
call_user_func( $this->render_callback , $fields, $attributes, $content, $post_id, $block );
$toReturn = ob_get_contents();
ob_clean();
return $toReturn;
}
/**

View file

View file

View file

View file

View file

View file

Some files were not shown because too many files have changed in this diff Show more