Skip to content

Commit

Permalink
WIP before design tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dwertheimer committed Oct 18, 2023
1 parent 5049f03 commit 2e0ab94
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dwertheimer.EventAutomations/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"noteplan.minAppVersion": "3.6",
"plugin.id": "dwertheimer.EventAutomations",
"plugin.name": "🗓 AutoTimeBlocking / Events",
"plugin.description": "Various Event Automations:\n- Automatically find time in your calendar and create Time Blocks for items marked for >today,\n- Write out synced copies of Today's todos (without the AutoTimeBlocking), and\n- Create calendar events for all text items under a specific heading",
"plugin.description": "Various Event Automations:\n- Automatically find time in your calendar and create Time Blocks for items marked for today,\n- Write out synced copies of Today's todos (without the AutoTimeBlocking), and\n- Create calendar events for all text items under a specific heading",
"plugin.author": "dwertheimer",
"plugin.version": "1.17.4-notreleased",
"plugin.lastUpdateInfo": "1.17.4: Minor calendar event improvement",
Expand Down
2 changes: 1 addition & 1 deletion np.plugin-test/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"plugin.name": "🔌 Plugin Information & Tester",
"plugin.description": "View Plugin Commands and Test that Plugins are working.",
"plugin.author": "@dwertheimer",
"plugin.version": "1.4.0-beta4",
"plugin.version": "1.4.0-beta5",
"plugin.lastUpdateInfo": "1.4.0-betaX: The beginning of a searchable plugin repository",
"plugin.dependencies": [],
"plugin.requiredFiles": [
Expand Down
11 changes: 10 additions & 1 deletion np.plugin-test/requiredFiles/css.plugin.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ h1, h2, h3, h4, h5, h6 {
font-weight: 500;
line-height: 1.2;
}
h3 {
background-color: beige;
font-size: 1.4rem;
margin-left: -10px;
padding-left: 10px;
padding-top: 5px;
padding-bottom: 5px;
}
.monospace { font-family: 'ui-monospace'; }
.monospaceData { font-family: 'ui-monospace'; font-size: 10px; white-space: pre-wrap }
/* loading spinner */
Expand Down Expand Up @@ -76,6 +84,7 @@ h1, h2, h3, h4, h5, h6 {

.plugin-section {
padding: 10px;
padding-top: 0px;
}

.pluginName {
Expand Down Expand Up @@ -154,6 +163,6 @@ h1, h2, h3, h4, h5, h6 {
}

.PluginListingPage {
margin-top: 55px;
margin-top: 75px;
}
}
3 changes: 1 addition & 2 deletions np.plugin-test/src/pluginCommandsPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ export async function openReactPluginCommandsWindow() {
// The second line needs to be updated to your pluginID in order to load any specific CSS you want to include for the React Window (in requiredFiles)
const cssTagsString = `
<link rel="stylesheet" href="../np.Shared/css.w3.css">
<link rel="stylesheet" href="../np.plugin-test/css.plugin.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">\n`
<link rel="stylesheet" href="../np.plugin-test/css.plugin.css">`
const windowOptions = {
savedFilename: `../../${pluginJson['plugin.id']}/savedOutput.html` /* for saving a debug version of the html file */,
headerTags: cssTagsString,
Expand Down
9 changes: 5 additions & 4 deletions np.plugin-test/src/react/PluginListingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare var NP_THEME: {
editor: {
backgroundColor: string,
altColor: string,
altBackgroundColor: string,
},
}

Expand Down Expand Up @@ -70,6 +70,10 @@ const viewOptions = [
{ label: 'Commands Only', value: 'commandsOnly' },
]

const colorDiff = howDifferentAreTheseColors(NP_THEME.editor.backgroundColor, NP_THEME.editor.altBackgroundColor)
logDebug(`PluginSection: howDifferentAreTheseColors background vs altBackground:${howDifferentAreTheseColors(NP_THEME.editor.backgroundColor, NP_THEME.editor.altBackgroundColor)}`)
const altColor = !colorDiff || colorDiff < 5 ? getAltColor(NP_THEME.editor.backgroundColor) : NP_THEME.editor.altBackgroundColor

/**
* HTML OUTPUT FOR EACH COMMAND
*/
Expand Down Expand Up @@ -114,8 +118,6 @@ type PluginSectionProps = {
function PluginSection({ plugin, viewOption, index }: PluginSectionProps): React$Node {
const installedDisplayString = plugin.isInstalled ? 'installed' : 'install'
const updateIsAvailableString = plugin.updateIsAvailable ? '(update available)' : ''
const colorDiff = howDifferentAreTheseColors(NP_THEME.editor.backgroundColor, NP_THEME.editor.altColor)
const altColor = !colorDiff || colorDiff < 20 ? getAltColor(NP_THEME.editor.backgroundColor) : NP_THEME.editor.altColor

const pluginSectionStyle = {
backgroundColor: index % 2 === 0 ? altColor : 'inherit',
Expand Down Expand Up @@ -197,7 +199,6 @@ function PluginListingPage(props: Props): React$Node {
}
})
const filteredPluginsAndCommands = filterCommands({ pluginList: filteredPlugins ?? [], filter: filter, categoryFilter: categoryFilter, returnOnlyMatchingCommands: true })
console.log('filteredPluginsAndCommands SAMPLE OUPUT', JSON.stringify(filteredPluginsAndCommands.filter((plugin, index) => index < 1)))
const filterDivStyle = { backgroundColor: NP_THEME.editor.backgroundColor }
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion np.plugin-test/src/react/support/filterFunctions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type FilterCommandsProps = {
* Filter plugin list down to only plugins and (optionally only commands) that include the filter list
*/
export function filterCommands({ pluginList, filter = '', categoryFilter = '', returnOnlyMatchingCommands = false }: FilterCommandsProps): Array<Plugin> {
console.log('Variables passed to filterCommands:', { pluginList, filter, returnOnlyMatchingCommands, categoryFilter })
// console.log('Variables passed to filterCommands:', { pluginList, filter, returnOnlyMatchingCommands, categoryFilter })
const filters = filter
? filter
.toLowerCase()
Expand Down

0 comments on commit 2e0ab94

Please sign in to comment.