chore (refactoring): import path for lib related stuff

This commit is contained in:
Mickael Kerjean 2023-07-25 23:55:32 +10:00
parent c83f57f8b2
commit 26b4f0bb19
26 changed files with 35 additions and 145 deletions

View file

@ -1,7 +1,7 @@
import { createElement } from "../lib/skeleton/index.js";
import rxjs, { applyMutation } from "../lib/rxjs/index.js";
import { animate } from "../lib/animate/index.js";
import { qs } from "../lib/dom/index.js";
import rxjs, { applyMutation } from "../lib/rx.js";
import { animate } from "../lib/animate.js";
import { qs } from "../lib/dom.js";
import CSSLoader from "../../helpers/css.js";
// http://127.0.0.1:8000/admin/setup

View file

@ -1,5 +1,5 @@
import rxjs, { ajax } from "../rxjs/index.js";
import { AjaxError } from "../error/index.js";
import rxjs, { ajax } from "./rx.js";
import { AjaxError } from "./error.js";
export default function(opts) {
if (typeof opts === "string") opts = { url: opts };

View file

@ -1,5 +1,5 @@
import { onDestroy, createElement } from "../skeleton/index.js";
import rxjs from "../rxjs/index.js";
import { onDestroy, createElement } from "./skeleton/index.js";
import rxjs from "./rx.js";
export function transition($node, opts = {}) {
const {

View file

@ -1,110 +0,0 @@
const sleep = (t) => new Promise((done) => setTimeout(done, t));
export async function requestAnimation() {
return new Promise((done) => requestAnimationFrame(done));
}
export async function enterAnimation($node, timeout) {
$node.classList.remove("leave", "leave-active", "enter", "enter-active");
await requestAnimation();
$node.classList.add("enter");
await requestAnimation();
$node.classList.add("enter-active")
await sleep(timeout);
$node.classList.remove("enter", "enter-active");
}
export async function leaveAnimation($node, timeout) {
$node.classList.remove("leave", "leave-active", "enter", "enter-active");
await requestAnimation();
$node.classList.add("leave");
await requestAnimation();
$node.classList.add("leave-active")
await sleep(timeout);
}
export function slideXIn(size) {
return function (querySelector, t){
return `
${querySelector}.enter {
opacity: 0;
transform: translateX(${size}px);
}
${querySelector}.enter.enter-active {
opacity: 1;
transform: translateX(0);
transition: all ${t}ms ease;
}`;
}
}
export function slideYIn(size) {
return function (querySelector, t){
return `
${querySelector}.enter {
opacity: 0;
transform: translateY(${size}px);
}
${querySelector}.enter.enter-active {
opacity: 1;
transform: translateY(0);
transition: all ${t}ms ease;
}`;
}
}
export function slideXOut(size) {
return function (querySelector, t){
return `
${querySelector}.leave {
opacity: 1;
transform: translateX(0);
}
${querySelector}.leave.leave-active {
opacity: 0;
transform: translateX(${size}px);
transition: all ${t}ms ease;
}`;
}
}
export function slideYOut(size) {
return function (querySelector, t){
return `
${querySelector}.leave {
opacity: 1;
transform: translateY(0);
}
${querySelector}.leave.leave-active {
opacity: 0;
transform: translateY(${size}px);
transition: all ${t}ms ease;
}`;
}
}
export function opacityIn() {
return function (querySelector, t){
return `
${querySelector}.enter {
opacity: 0;
}
${querySelector}.enter.enter-active {
opacity: 1;
transition: opacity ${t}ms ease;
}`;
}
}
export function opacityOut() {
return function (querySelector, t){
return `
${querySelector}.leave {
opacity: 1;
}
${querySelector}.leave.leave-active {
opacity: 0;
transition: opacity ${t}ms ease;
}`;
}
}

View file

@ -1,4 +1,4 @@
import { onDestroy } from "../skeleton/index.js";
import { onDestroy } from "./skeleton/index.js";
// https://github.com/ReactiveX/rxjs/issues/4416#issuecomment-620847759
const rxjsModule = await import("./vendor/rxjs.min.js");

View file

@ -1,4 +1,4 @@
import { transition } from "../../lib/animate/index.js";
import { transition } from "../../lib/animate.js";
export default function($node) {
return transition($node, {

View file

@ -1,6 +1,6 @@
import { createElement } from "../../lib/skeleton/index.js";
import rxjs, { effect, stateMutation } from "../../lib/rxjs/index.js"
import { qs } from "../../lib/dom/index.js";
import rxjs, { effect, stateMutation } from "../../lib/rx.js"
import { qs } from "../../lib/dom.js";
import CSSLoader from "../../helpers/css.js";
import transition from "./animate.js";

View file

@ -1,5 +1,5 @@
import { createElement } from "../../lib/skeleton/index.js";
import { effect } from "../../lib/rxjs/index.js";
import { effect } from "../../lib/rx.js";
import transition from "./animate.js";
import AdminOnly from "./decorator_admin_only.js";

View file

@ -1,5 +1,5 @@
import { createElement, createRender } from "../../lib/skeleton/index.js";
import { effect } from "../../lib/rxjs/index.js";
import { effect } from "../../lib/rx.js";
import transition from "./animate.js";
import AdminOnly from "./decorator_admin_only.js";

View file

@ -1,7 +1,7 @@
import { createElement } from "../../lib/skeleton/index.js";
import rxjs, { effect, stateMutation, applyMutation, preventDefault } from "../../lib/rxjs/index.js";
import { qs } from "../../lib/dom/index.js";
import { transition } from "../../lib/animate/index.js";
import rxjs, { effect, stateMutation, applyMutation, preventDefault } from "../../lib/rx.js";
import { qs } from "../../lib/dom.js";
import { transition } from "../../lib/animate.js";
import CSSLoader from "../../helpers/css.js";
import { zoomIn } from "./animate.js";

View file

@ -1,8 +1,8 @@
import { createElement, createRender, onDestroy } from "../../lib/skeleton/index.js";
import rxjs, { effect, stateMutation, applyMutation, preventDefault } from "../../lib/rxjs/index.js";
import { qs } from "../../lib/dom/index.js";
import { ApplicationError } from "../../lib/error/index.js";
import { transition, animate } from "../../lib/animate/index.js";
import rxjs, { effect, stateMutation, applyMutation, preventDefault } from "../../lib/rx.js";
import { qs } from "../../lib/dom.js";
import { ApplicationError } from "../../lib/error.js";
import { transition, animate } from "../../lib/animate.js";
import CSSLoader from "../../helpers/css.js";
import modal from "../../helpers/modal.js";

View file

@ -1,5 +1,5 @@
import { createElement, onDestroy } from "../../lib/skeleton/index.js";
import rxjs, { effect } from "../../lib/rxjs/index.js";
import rxjs, { effect } from "../../lib/rx.js";
import ctrlLogin from "./ctrl_login.js";
import ctrlError from "../ctrl_error.js";

View file

@ -1,6 +1,6 @@
import { createElement } from "../../../lib/skeleton/index.js";
import rxjs, { effect, stateMutation } from "../../../lib/rxjs/index.js";
import { qs } from "../../lib/dom/index.js";
import rxjs, { effect, stateMutation } from "../../../lib/rx.js";
import { qs } from "../../lib/dom.js";
import CSSLoader from "../../helpers/css.js";

View file

@ -1,5 +1,5 @@
import rxjs from "../../lib/rxjs/index.js";
import ajax from "../../lib/ajax/index.js";
import rxjs from "../../lib/rx.js";
import ajax from "../../lib/ajax.js";
window.ajax = ajax;

View file

@ -1,4 +1,4 @@
import rxjs from "../../lib/rxjs/index.js";
import rxjs from "../../lib/rx.js";
class ConfigManager {

View file

@ -1,5 +1,5 @@
import rxjs from "../../lib/rxjs/index.js";
import ajax from "../../lib/ajax/index.js";
import rxjs from "../../lib/rx.js";
import ajax from "../../lib/ajax.js";
const release$ = ajax({
url: "/about",

View file

@ -1,9 +1,9 @@
import { createElement } from "../lib/skeleton/index.js";
import rxjs, { effect, applyMutation } from "../lib/rxjs/index.js";
import { qs } from "../lib/dom/index.js";
import t from "../lib/locales/index.js";
import rxjs, { effect, applyMutation } from "../lib/rx.js";
import { qs } from "../lib/dom.js";
import t from "../lib/locales.js";
import { AjaxError, ApplicationError } from "../lib/error/index.js";
import { AjaxError, ApplicationError } from "../lib/error.js";
import CSSLoader from "../helpers/css.js";
import "../../components/icon.js";

View file

@ -1,6 +1,6 @@
import { createElement, navigate } from "../lib/skeleton/index.js";
import rxjs, { effect } from "../lib/rxjs/index.js";
import ajax from "../lib/ajax/index.js";
import rxjs, { effect } from "../lib/rx.js";
import ajax from "../lib/ajax.js";
import ctrlError from "./ctrl_error.js";
import "../components/icon.js";

View file

@ -1,4 +1,4 @@
import ctrlError from "./ctrl_error.js";
import { ApplicationError } from "../lib/error/index.js";
import { ApplicationError } from "../lib/error.js";
export default ctrlError(new ApplicationError("Not Found"));