mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Remove maze utils from npm deps
This commit is contained in:
parent
75eb63632f
commit
0f7ed9926c
26 changed files with 52 additions and 85 deletions
32
package-lock.json
generated
32
package-lock.json
generated
|
@ -27,7 +27,6 @@
|
|||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@ajayyy/maze-utils": "1.1.37",
|
||||
"content-scripts-register-polyfill": "^4.0.2",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
|
@ -66,32 +65,6 @@
|
|||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@ajayyy/maze-utils": {
|
||||
"version": "1.1.37",
|
||||
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.37.tgz",
|
||||
"integrity": "sha512-EOec/tfgTDdG2RFzfGdRpyBE3ACE7sAmzfKGzLZqhNznQGcCt/gELw49dHf7NeFzU+EU5vJ2jzTDizfB96gBMg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://sponsor.ajay.app/donate"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ajayyy-org"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/ajayyy"
|
||||
},
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://paypal.me/ajayyy"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
|
||||
|
@ -13601,11 +13574,6 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@ajayyy/maze-utils": {
|
||||
"version": "1.1.37",
|
||||
"resolved": "https://registry.npmjs.org/@ajayyy/maze-utils/-/maze-utils-1.1.37.tgz",
|
||||
"integrity": "sha512-EOec/tfgTDdG2RFzfGdRpyBE3ACE7sAmzfKGzLZqhNznQGcCt/gELw49dHf7NeFzU+EU5vJ2jzTDizfB96gBMg=="
|
||||
},
|
||||
"@ampproject/remapping": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
"description": "",
|
||||
"main": "background.js",
|
||||
"dependencies": {
|
||||
"@ajayyy/maze-utils": "1.1.37",
|
||||
"content-scripts-register-polyfill": "^4.0.2",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
|
|
|
@ -3,9 +3,9 @@ import * as CompileConfig from "../config.json";
|
|||
import Config from "./config";
|
||||
import { Registration } from "./types";
|
||||
import "content-scripts-register-polyfill";
|
||||
import { sendRealRequestToCustomServer, setupBackgroundRequestProxy } from "@ajayyy/maze-utils/lib/background-request-proxy";
|
||||
import { setupTabUpdates } from "@ajayyy/maze-utils/lib/tab-updates";
|
||||
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { sendRealRequestToCustomServer, setupBackgroundRequestProxy } from "./maze-utils/background-request-proxy";
|
||||
import { setupTabUpdates } from "./maze-utils/tab-updates";
|
||||
import { generateUserID } from "./maze-utils/setup";
|
||||
|
||||
// Make the config public for debugging purposes
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
|
|||
import { VoteResponse } from "../messageTypes";
|
||||
import { AnimationUtils } from "../utils/animationUtils";
|
||||
import { Tooltip } from "../render/Tooltip";
|
||||
import { getErrorMessage } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { getErrorMessage } from "../maze-utils/formating";
|
||||
|
||||
export interface CategoryPillProps {
|
||||
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
|
||||
|
|
|
@ -8,7 +8,7 @@ import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
|
|||
import { VoteResponse } from "../messageTypes";
|
||||
import { AnimationUtils } from "../utils/animationUtils";
|
||||
import { Tooltip } from "../render/Tooltip";
|
||||
import { getErrorMessage } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { getErrorMessage } from "../maze-utils/formating";
|
||||
|
||||
export interface ChapterVoteProps {
|
||||
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
|
||||
|
|
|
@ -12,8 +12,8 @@ import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
|
|||
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
|
||||
import PencilSvg from "../svg-icons/pencil_svg";
|
||||
import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
|
||||
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { keybindToString } from "@ajayyy/maze-utils/lib/config";
|
||||
import { generateUserID } from "../maze-utils/setup";
|
||||
import { keybindToString } from "../maze-utils/config";
|
||||
|
||||
enum SkipButtonState {
|
||||
Undo, // Unskip
|
||||
|
|
|
@ -7,7 +7,7 @@ import SubmissionNoticeComponent from "./SubmissionNoticeComponent";
|
|||
import { RectangleTooltip } from "../render/RectangleTooltip";
|
||||
import SelectorComponent, { SelectorOption } from "./SelectorComponent";
|
||||
import { DEFAULT_CATEGORY } from "../utils/categoryUtils";
|
||||
import { getFormattedTime, getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { getFormattedTime, getFormattedTimeToSeconds } from "../maze-utils/formating";
|
||||
|
||||
const utils = new Utils();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import * as React from "react";
|
|||
import { createRoot, Root } from 'react-dom/client';
|
||||
import Config from "../../config";
|
||||
import KeybindDialogComponent from "./KeybindDialogComponent";
|
||||
import { formatKey, Keybind, keybindEquals, keybindToString } from "@ajayyy/maze-utils/lib/config";
|
||||
import { formatKey, Keybind, keybindEquals, keybindToString } from "../../maze-utils/config";
|
||||
|
||||
export interface KeybindProps {
|
||||
option: string;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from "react";
|
||||
import { ChangeEvent } from "react";
|
||||
import Config from "../../config";
|
||||
import { Keybind, formatKey, keybindEquals } from "@ajayyy/maze-utils/lib/config";
|
||||
import { Keybind, formatKey, keybindEquals } from "../../maze-utils/config";
|
||||
|
||||
export interface KeybindDialogProps {
|
||||
option: string;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as CompileConfig from "../config.json";
|
||||
import * as invidiousList from "../ci/invidiouslist.json";
|
||||
import { Category, CategorySelection, CategorySkipOption, NoticeVisbilityMode, PreviewBarOption, SponsorTime, VideoID, SponsorHideType } from "./types";
|
||||
import { Keybind, ProtoConfig, keybindEquals } from "@ajayyy/maze-utils/lib/config";
|
||||
import { HashedValue } from "@ajayyy/maze-utils/lib/hash";
|
||||
import { Keybind, ProtoConfig, keybindEquals } from "./maze-utils/config";
|
||||
import { HashedValue } from "./maze-utils/hash";
|
||||
|
||||
export interface Permission {
|
||||
canSubmit: boolean;
|
||||
|
|
|
@ -32,14 +32,14 @@ import { logDebug } from "./utils/logger";
|
|||
import { importTimes } from "./utils/exporter";
|
||||
import { ChapterVote } from "./render/ChapterVote";
|
||||
import { openWarningDialog } from "./utils/warnings";
|
||||
import { isFirefoxOrSafari, waitFor } from "@ajayyy/maze-utils";
|
||||
import { getErrorMessage, getFormattedTime } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "@ajayyy/maze-utils/lib/video";
|
||||
import { Keybind, StorageChangesObject, isSafari, keybindEquals } from "@ajayyy/maze-utils/lib/config";
|
||||
import { findValidElement, waitForElement } from "@ajayyy/maze-utils/lib/dom"
|
||||
import { getHash, HashedValue } from "@ajayyy/maze-utils/lib/hash";
|
||||
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { updateAll } from "@ajayyy/maze-utils/lib/thumbnailManagement";
|
||||
import { isFirefoxOrSafari, waitFor } from "./maze-utils";
|
||||
import { getErrorMessage, getFormattedTime } from "./maze-utils/formating";
|
||||
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "./maze-utils/video";
|
||||
import { Keybind, StorageChangesObject, isSafari, keybindEquals } from "./maze-utils/config";
|
||||
import { findValidElement, waitForElement } from "./maze-utils/dom"
|
||||
import { getHash, HashedValue } from "./maze-utils/hash";
|
||||
import { generateUserID } from "./maze-utils/setup";
|
||||
import { updateAll } from "./maze-utils/thumbnailManagement";
|
||||
import { setupThumbnailListener } from "./utils/thumbnails";
|
||||
import * as documentScript from "../dist/js/document.js";
|
||||
import { Tooltip } from "./render/Tooltip";
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import { init } from "@ajayyy/maze-utils/lib/injected/document";
|
||||
import { init } from "./maze-utils/injected/document";
|
||||
|
||||
init();
|
|
@ -1,8 +1,8 @@
|
|||
import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { localizeHtmlPage } from "./maze-utils/setup";
|
||||
import Config from "./config";
|
||||
import { showDonationLink } from "./utils/configUtils";
|
||||
|
||||
import { waitFor } from "@ajayyy/maze-utils";
|
||||
import { waitFor } from "./maze-utils";
|
||||
|
||||
window.addEventListener('DOMContentLoaded', init);
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceT
|
|||
import { partition } from "../utils/arrayUtils";
|
||||
import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils";
|
||||
import { normalizeChapterName } from "../utils/exporter";
|
||||
import { getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { findValidElement } from "@ajayyy/maze-utils/lib/dom";
|
||||
import { getFormattedTimeToSeconds } from "../maze-utils/formating";
|
||||
import { findValidElement } from "../maze-utils/dom";
|
||||
|
||||
const TOOLTIP_VISIBLE_CLASS = 'sponsorCategoryTooltipVisible';
|
||||
const MIN_CHAPTER_SIZE = 0.003;
|
||||
|
|
|
@ -2,7 +2,7 @@ import Config from "../config";
|
|||
import { SponsorTime } from "../types";
|
||||
import { getSkippingText } from "../utils/categoryUtils";
|
||||
import { AnimationUtils } from "../utils/animationUtils";
|
||||
import { keybindToString } from "@ajayyy/maze-utils/lib/config";
|
||||
import { keybindToString } from "../maze-utils/config";
|
||||
|
||||
export interface SkipButtonControlBarProps {
|
||||
skip: (segment: SponsorTime) => void;
|
||||
|
|
|
@ -13,10 +13,10 @@ import CategoryChooser from "./render/CategoryChooser";
|
|||
import UnsubmittedVideos from "./render/UnsubmittedVideos";
|
||||
import KeybindComponent from "./components/options/KeybindComponent";
|
||||
import { showDonationLink } from "./utils/configUtils";
|
||||
import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config";
|
||||
import { getHash } from "@ajayyy/maze-utils/lib/hash";
|
||||
import { isFirefoxOrSafari } from "@ajayyy/maze-utils";
|
||||
import { localizeHtmlPage } from "./maze-utils/setup";
|
||||
import { StorageChangesObject } from "./maze-utils/config";
|
||||
import { getHash } from "./maze-utils/hash";
|
||||
import { isFirefoxOrSafari } from "./maze-utils";
|
||||
import { isDeArrowInstalled } from "./utils/crossExtension";
|
||||
const utils = new Utils();
|
||||
let embed = false;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Config from "./config";
|
||||
import Utils from "./utils";
|
||||
import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { localizeHtmlPage } from "./maze-utils/setup";
|
||||
const utils = new Utils();
|
||||
|
||||
// This is needed, if Config is not imported before Utils, things break.
|
||||
|
|
|
@ -21,12 +21,12 @@ import {
|
|||
import { showDonationLink } from "./utils/configUtils";
|
||||
import { AnimationUtils } from "./utils/animationUtils";
|
||||
import { shortCategoryName } from "./utils/categoryUtils";
|
||||
import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { localizeHtmlPage } from "./maze-utils/setup";
|
||||
import { exportTimes } from "./utils/exporter";
|
||||
import GenericNotice from "./render/GenericNotice";
|
||||
import { getErrorMessage, getFormattedTime } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config";
|
||||
import { getHash } from "@ajayyy/maze-utils/lib/hash";
|
||||
import { getErrorMessage, getFormattedTime } from "./maze-utils/formating";
|
||||
import { StorageChangesObject } from "./maze-utils/config";
|
||||
import { getHash } from "./maze-utils/hash";
|
||||
|
||||
const utils = new Utils();
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import Config from "../config";
|
|||
import { VoteResponse } from "../messageTypes";
|
||||
import { Category, SegmentUUID, SponsorTime } from "../types";
|
||||
import { Tooltip } from "./Tooltip";
|
||||
import { waitFor } from "@ajayyy/maze-utils";
|
||||
import { getYouTubeTitleNode } from "@ajayyy/maze-utils/lib/elements";
|
||||
import { waitFor } from "../maze-utils";
|
||||
import { getYouTubeTitleNode } from "../maze-utils/elements";
|
||||
|
||||
const id = "categoryPill";
|
||||
|
||||
|
|
10
src/utils.ts
10
src/utils.ts
|
@ -1,12 +1,12 @@
|
|||
import Config, { VideoDownvotes } from "./config";
|
||||
import { CategorySelection, SponsorTime, BackgroundScriptContainer, Registration, VideoID, SponsorHideType, CategorySkipOption } from "./types";
|
||||
|
||||
import { getHash, HashedValue } from "@ajayyy/maze-utils/lib/hash";
|
||||
import { getHash, HashedValue } from "./maze-utils/hash";
|
||||
import * as CompileConfig from "../config.json";
|
||||
import { isFirefoxOrSafari, waitFor } from "@ajayyy/maze-utils";
|
||||
import { findValidElementFromSelector } from "@ajayyy/maze-utils/lib/dom";
|
||||
import { FetchResponse, sendRequestToCustomServer } from "@ajayyy/maze-utils/lib/background-request-proxy"
|
||||
import { isSafari } from "@ajayyy/maze-utils/lib/config";
|
||||
import { isFirefoxOrSafari, waitFor } from "./maze-utils";
|
||||
import { findValidElementFromSelector } from "./maze-utils/dom";
|
||||
import { FetchResponse, sendRequestToCustomServer } from "./maze-utils/background-request-proxy"
|
||||
import { isSafari } from "./maze-utils/config";
|
||||
|
||||
export default class Utils {
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as CompileConfig from "../../config.json";
|
||||
|
||||
import Config from "../config";
|
||||
import { isSafari } from "@ajayyy/maze-utils/lib/config";
|
||||
import { isFirefoxOrSafari } from "@ajayyy/maze-utils";
|
||||
import { isSafari } from "../maze-utils/config";
|
||||
import { isFirefoxOrSafari } from "../maze-utils";
|
||||
|
||||
export function isDeArrowInstalled(): Promise<boolean> {
|
||||
if (Config.config.deArrowInstalled) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { ActionType, Category, SegmentUUID, SponsorSourceType, SponsorTime } from "../types";
|
||||
import { shortCategoryName } from "./categoryUtils";
|
||||
import * as CompileConfig from "../../config.json";
|
||||
import { getFormattedTime, getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
|
||||
import { getFormattedTime, getFormattedTimeToSeconds } from "../maze-utils/formating";
|
||||
import { generateUserID } from "../maze-utils/setup";
|
||||
|
||||
const inTest = typeof chrome === "undefined";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ActionType, Category, SponsorSourceType, SponsorTime, VideoID } from "../types";
|
||||
import { getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating";
|
||||
import { getFormattedTimeToSeconds } from "../maze-utils/formating";
|
||||
|
||||
export function getControls(): HTMLElement {
|
||||
const controlsSelectors = [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { isOnInvidious, parseYouTubeVideoIDFromURL } from "@ajayyy/maze-utils/lib/video";
|
||||
import { isOnInvidious, parseYouTubeVideoIDFromURL } from "../maze-utils/video";
|
||||
import Config from "../config";
|
||||
import { getVideoLabel } from "./videoLabels";
|
||||
import { setThumbnailListener } from "@ajayyy/maze-utils/lib/thumbnailManagement";
|
||||
import { setThumbnailListener } from "../maze-utils/thumbnailManagement";
|
||||
|
||||
export async function labelThumbnails(thumbnails: HTMLImageElement[]): Promise<void> {
|
||||
await Promise.all(thumbnails.map((t) => labelThumbnail(t)));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Category, CategorySkipOption, VideoID } from "../types";
|
||||
import { getHash } from "@ajayyy/maze-utils/lib/hash";
|
||||
import { getHash } from "../maze-utils/hash";
|
||||
import Utils from "../utils";
|
||||
import { logWarn } from "./logger";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { objectToURI } from "@ajayyy/maze-utils";
|
||||
import { getHash } from "@ajayyy/maze-utils/lib/hash";
|
||||
import { objectToURI } from "../maze-utils";
|
||||
import { getHash } from "../maze-utils/hash";
|
||||
import Config from "../config";
|
||||
import GenericNotice, { NoticeOptions } from "../render/GenericNotice";
|
||||
import { ContentContainer } from "../types";
|
||||
|
|
Loading…
Reference in a new issue