From a25ab2040c4b012df3c69039793c3b494c05e60a Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Mon, 5 Jun 2023 15:45:26 +0200 Subject: [PATCH] removed some css to improve chrome col layout perf --- app/imports/api/creature/actions/Actions.js | 27 +++++++++++++++++++ .../library/methods/getDefaultSlotFiller.js | 13 +++++++++ .../client/ui/components/ColumnLayout.vue | 13 +++++---- 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 app/imports/api/creature/actions/Actions.js create mode 100644 app/imports/api/library/methods/getDefaultSlotFiller.js diff --git a/app/imports/api/creature/actions/Actions.js b/app/imports/api/creature/actions/Actions.js new file mode 100644 index 00000000..947c779b --- /dev/null +++ b/app/imports/api/creature/actions/Actions.js @@ -0,0 +1,27 @@ +import SimpleSchema from 'simpl-schema'; + +// Actions are creature actions that have been partially executed and not yet resolved +// They require some user input to progress +let Actions = new Mongo.Collection('actions'); + +let CreaturePropertySchema = new SimpleSchema({ + _id: { + type: String, + regEx: SimpleSchema.RegEx.Id, + }, + // Which creature is taking the action + _creatureId: { + type: String, + regEx: SimpleSchema.RegEx.Id, + }, + // The user who began taking the action + user: { + type: String, + regEx: SimpleSchema.RegEx.Id, + }, + // The property that is about to be applied + property: { + type: String, + regEx: SimpleSchema.RegEx.Id, + }, +}); diff --git a/app/imports/api/library/methods/getDefaultSlotFiller.js b/app/imports/api/library/methods/getDefaultSlotFiller.js new file mode 100644 index 00000000..f704bbf7 --- /dev/null +++ b/app/imports/api/library/methods/getDefaultSlotFiller.js @@ -0,0 +1,13 @@ +export default function getDefaultSlotFiller(slot) { + if (typeof slot !== 'object') throw 'getDefaultSlotFiller requires a slot'; + if (slot.type !== 'propertySlot') throw 'provided slot must be a propertySlot'; + + const filler = { + type: slot.slotType || 'folder', + libraryTags: slot.slotTags || [], + name: 'Custom ' + slot.name || 'slot filler', + parent: { collection: 'creatureProperties', id: slot._id }, + ancestors: [...slot.ancestors, { collection: 'creatureProperties', id: slot._id }], + }; + return filler; +} diff --git a/app/imports/client/ui/components/ColumnLayout.vue b/app/imports/client/ui/components/ColumnLayout.vue index 16721057..2d5341a5 100644 --- a/app/imports/client/ui/components/ColumnLayout.vue +++ b/app/imports/client/ui/components/ColumnLayout.vue @@ -16,6 +16,14 @@ export default { wideColumns: Boolean, }, }; + +/* +Removed to improve chrome layout performance, put it back if there are rendering errors +.column-layout>span>div { + display: table; + table-layout: fixed; +} +*/