-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- v2.4.0
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.6
- v2.2.5
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.23
- v2.0.22
- v2.0.21
- v2.0.20
- v2.0.19
- v2.0.18
- v2.0.17
- v2.0.16
- v2.0.15
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.18
- v1.6.17
- v1.6.16
- v1.6.15
- v1.6.14
- v1.6.13
- v1.6.12
- v1.6.11
- v1.6.10
- v1.6.9
- v1.6.8
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.16
- v1.4.15
Showing
22 changed files
with
183 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
import { logseq as PL } from '../../package.json'; | ||
import { logseq as PL } from '../../../package.json'; | ||
|
||
type globalContextType = { | ||
type globalsType = { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
[key: string]: any; | ||
} | ||
|
||
export const globalContext: globalContextType = { | ||
export const doc = parent.document; | ||
export const root = doc.documentElement; | ||
export const body = doc.body; | ||
|
||
export const globals: globalsType = { | ||
pluginID: PL.id, | ||
pluginConfig: null, | ||
isPluginEnabled: 'is-awUi-enabled', | ||
isSearchOpenedClass: 'is-search-opened', | ||
isThemesOpenedClass: 'is-themes-opened', | ||
isSearchEnabledClass: 'awUi-search', | ||
promoAwesomeStylerMsg: 'To customize UI & content text/bg colors, install "Awesome Styler" (former "Solarized Extended") theme! https://github.com/yoyurec/logseq-awesome-styler', | ||
tabsPluginIframe: null | ||
tabsPluginIframe: null, | ||
getDOMContainers() { | ||
this.modalContainer = doc.querySelector('.ui__modal-panel'); | ||
} | ||
}; | ||
|
||
export let modalContainer: HTMLElement | null; | ||
|
||
export const doc = parent.document; | ||
export const root = doc.documentElement; | ||
export const body = doc.body; | ||
|
||
export const getDOMContainers = () => { | ||
modalContainer = doc.querySelector('.ui__modal-panel'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { doc, globals } from '../globals/globals'; | ||
|
||
|
||
export const hideProps = async () => { | ||
if (!globals.pluginConfig.featureHideDotProps && !globals.pluginConfig.featureHideSetOfProps) { | ||
return; | ||
} | ||
let hidePropsArr: string[] = []; | ||
if (globals.pluginConfig.featureHideSetOfProps) { | ||
hidePropsArr = (globals.pluginConfig.featureHideSetOfProps as string).trim().toLowerCase().replaceAll(', ', ',').split(','); | ||
} | ||
const propKeyList = doc.querySelectorAll('.block-properties .page-property-key'); | ||
if (propKeyList.length) { | ||
for (let i = 0; i < propKeyList.length; i++) { | ||
const propKeyItemText = propKeyList[i].textContent; | ||
const propItem = propKeyList[i].parentElement!.parentElement; | ||
if (propKeyItemText && propItem) { | ||
if (globals.pluginConfig.featureHideDotProps && propKeyItemText?.startsWith('.')) { | ||
propItem.classList.add('hidden', 'awUI-hideDotProp'); | ||
} else if (globals.pluginConfig.featureHideSetOfProps && hidePropsArr.includes(propKeyItemText)) { | ||
propItem.classList.add('hidden', 'awUI-hideSetOfProps'); | ||
} else { | ||
propItem.classList.remove('hidden', 'awUI-hideSetOfProps'); | ||
} | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,46 @@ | ||
import { doc } from '../internal'; | ||
import { hideProps } from '../internal'; | ||
import { doc } from '../globals/globals'; | ||
import { hideProps } from './hideProps'; | ||
|
||
let propsChangedObserverConfig: MutationObserverInit; | ||
let propsChangedObserver: MutationObserver; | ||
|
||
export const propsChangedObserverInit = () => { | ||
propsChangedObserverConfig = { | ||
attributes: true, | ||
attributeFilter: ['class'], | ||
attributeOldValue: true, | ||
subtree: true | ||
} | ||
const propsChangedCallback: MutationCallback = function (mutationsList) { | ||
for (let i = 0; i < mutationsList.length; i++) { | ||
const mutationItem = mutationsList[i]; | ||
const mutationTarget = mutationItem.target as HTMLElement; | ||
if (mutationTarget && mutationTarget.offsetParent?.classList.contains('pre-block') && mutationItem.oldValue === 'editor-wrapper') { | ||
setTimeout(() => { | ||
hideProps(); | ||
}, 10) | ||
} | ||
} | ||
} | ||
propsChangedObserver = new MutationObserver(propsChangedCallback); | ||
} | ||
propsChangedObserverConfig = { | ||
attributes: true, | ||
attributeFilter: ['class'], | ||
attributeOldValue: true, | ||
subtree: true, | ||
}; | ||
const propsChangedCallback: MutationCallback = function (mutationsList) { | ||
for (let i = 0; i < mutationsList.length; i++) { | ||
const mutationItem = mutationsList[i]; | ||
const mutationTarget = mutationItem.target as HTMLElement; | ||
if ( | ||
mutationTarget && | ||
mutationTarget.offsetParent?.classList.contains('pre-block') && | ||
mutationItem.oldValue === 'editor-wrapper' | ||
) { | ||
setTimeout(() => { | ||
onPropsChanged(); | ||
}, 10); | ||
} | ||
} | ||
}; | ||
propsChangedObserver = new MutationObserver(propsChangedCallback); | ||
}; | ||
|
||
const onPropsChanged = () => { | ||
hideProps(); | ||
}; | ||
|
||
export const propsChangedObserverRun = () => { | ||
const preBlock = doc.getElementsByClassName('content')[0]?.firstChild?.firstChild?.firstChild?.firstChild; | ||
if (preBlock) { | ||
propsChangedObserver.observe(preBlock, propsChangedObserverConfig); | ||
} | ||
} | ||
const preBlock = | ||
doc.getElementsByClassName('content')[0]?.firstChild?.firstChild?.firstChild?.firstChild; | ||
if (preBlock) { | ||
propsChangedObserver.observe(preBlock, propsChangedObserverConfig); | ||
} | ||
}; | ||
|
||
export const propsChangedObserverStop = () => { | ||
propsChangedObserver.disconnect(); | ||
} | ||
propsChangedObserver.disconnect(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { doc } from '../internal'; | ||
import { doc } from '../globals/globals'; | ||
|
||
import './sidebars.css'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters