Looky1173

Looky1173

Member Since 1 year ago

[object Object]

Experience Points
5
follower
Lessons Completed
17
follow
Lessons Completed
108
stars
Best Reply Awards
17
repos

140 contributions in the last year

Pinned
⚡ Scratch Tools is a website that allows Scratchers to collaborate together on the same project, manage shops; and it also offers practical tools for Scratch.
Activity
Jan
22
18 hours ago
Jan
6
2 weeks ago
started
started time in 2 weeks ago
Jan
1
3 weeks ago
started
started time in 3 weeks ago
Dec
31
3 weeks ago
Activity icon
issue

Looky1173 issue comment storybookjs/telejson

Looky1173
Looky1173

Not work for function

For example:

export const smooth = (fun: (offset: number) => number): (offset: number) => number => {
    return (offset: number): number => {
        const floor = Math.floor(offset);
        const ceil = Math.ceil(offset);
        if (floor === ceil) {
            return fun(offset);
        } else {
            return fun(floor) * (1 - offset + floor) + fun(ceil) * (offset - floor);
        }
    }
};

throw fun is not defined.

Looky1173
Looky1173

I don't think trying to modify the MUI theme to address this should be the fix - I think the problem is using a bad and seemingly unnecessary serialization of the theme in one of these addons.

I definitely agree! In fact, telejson is used in the core of Storybook as well. I think that this issue should be brought up in the main Storybook repository as it is more of an architectural problem. Sure, we could try implementing a dependency parser in telejson and include each dependency of the function serialized in the returned object, however, that would come with severe limitations and probably cause even more complications later on, as illustrated by this StackOverflow answer.

Dec
30
3 weeks ago
started
started time in 3 weeks ago
started
started time in 3 weeks ago
Dec
28
3 weeks ago
Activity icon
issue

Looky1173 issue comment storybookjs/telejson

Looky1173
Looky1173

Not work for function

For example:

export const smooth = (fun: (offset: number) => number): (offset: number) => number => {
    return (offset: number): number => {
        const floor = Math.floor(offset);
        const ceil = Math.ceil(offset);
        if (floor === ceil) {
            return fun(offset);
        } else {
            return fun(floor) * (1 - offset + floor) + fun(ceil) * (offset - floor);
        }
    }
};

throw fun is not defined.

Looky1173
Looky1173

@Looky1173 are you able to share this solution?

@austinmccalley I've scrapped my original hideous workaround and ended up doing nearly the same thing as @tlmader:

.storybook/preview.js

import { withThemesProvider } from 'themeprovider-storybook';
import { ThemeProvider } from 'styled-components';

const themes = []; // Your array of themes

/*
 * Serialize and deserialize theme to work around `values is not defined` error.
 * (Credit: https://github.com/storybookjs/telejson/issues/16#issuecomment-878359101)
*/
function customProvider({ theme, children }) {
    const serialTheme = JSON.parse(JSON.stringify(theme));
    const newTheme = customCreateThemeFunction(serialTheme); // This custom function returns a theme object
    return <ThemeProvider theme={newTheme}>{children}</ThemeProvider>;
}

export const decorators = [withThemesProvider(themes, { CustomThemeProvider: customProvider })];
started
started time in 3 weeks ago
Dec
27
3 weeks ago
started
started time in 3 weeks ago
Dec
21
1 month ago
started
started time in 1 month ago
Activity icon
issue

Looky1173 issue comment storybookjs/telejson

Looky1173
Looky1173

Not work for function

For example:

export const smooth = (fun: (offset: number) => number): (offset: number) => number => {
    return (offset: number): number => {
        const floor = Math.floor(offset);
        const ceil = Math.ceil(offset);
        if (floor === ceil) {
            return fun(offset);
        } else {
            return fun(floor) * (1 - offset + floor) + fun(ceil) * (offset - floor);
        }
    }
};

throw fun is not defined.

Looky1173
Looky1173

I've run into the same error and stumbled across this issue. Unlike others, I am using a custom createTheme() function with themeprovider-storybook therefore I can't use the aforementioned solution. Still, I managed to throw together something to work around the error but it is quite hacky and has a performance impact on my stories.

Is there any news on this? How is teleJSON essential for the workings of Storybook?

Dec
20
1 month ago
Activity icon
created branch

Looky1173 in Looky1173/umami create branch main

createdAt 1 month ago
Activity icon
created repository
createdAt 1 month ago
Dec
18
1 month ago
Activity icon
fork

Looky1173 forked material-foundation/material-color-utilities

⚡ Color libraries for Material You
Looky1173 Apache License 2.0 Updated
fork time in 1 month ago
Dec
6
1 month ago
started
started time in 1 month ago
Dec
5
1 month ago
started
started time in 1 month ago
Nov
24
1 month ago
started
started time in 1 month ago
Oct
31
2 months ago
Activity icon
issue

Looky1173 issue comment godotengine/godot-proposals

Looky1173
Looky1173

Add the ability to drag and drop text in the script editor with the mouse

Describe the project you are working on

This feature is not tied to a particular/specific use case of the Godot engine as it would benefit all users who make use of the built-in script editor.

Describe the problem or limitation you are having in your project

To rearrange text in the script editor one has to select it, copy it, move the cursor to the desired location, and finally paste it. This can become quite cumbersome to do especially for people who are limited to (primarely) using one hand to navigate the editor/engine.

Plus there are users, like me, who only have 1 fully working hand, so we try and minimize the need to swap between mouse and keyboard as doing that is slow.

The quote above is from this proposal that has been closed as this repository became the centralized way to propose Godot features/enhancements, and hasn't been reopened since. This shows that this problem concerns accessibility too and should be seriously considered.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

To overcome the problem above, a feature that allows users to select, drag, and drop text withing the editor should be added. It is a standard feature present in most text editors therefore it would benefit all users. Furthermore, such a feature would enhance the core experience of the built-in script editor and would make the Godot engine more accessible.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Here is a GIF from the original closed issue that demonstrates this feature: peek 2018-03-31 09-19

If this enhancement will not be used often, can it be worked around with a few lines of script?

This would be a core feature of the Godot engine and, as far as I'm aware, cannot be worked arround. Besides, it most likely would be used on a regular basis by the majority of users who use the built-in script editor.

Is there a reason why this should be core and not an add-on in the asset library?

This feature is about improving the usability and accessibility of the built-in script editor, thus it should be core.

Looky1173
Looky1173

@Calinou With all due respect, I believe this is not a duplicate of the linked issue, That proposal is asking for the implementation of a signal that would fire off when text/media is dragged into an input node. It has nothing to do with the built-in script editor and is quite ambigous. Therefore, I think this issue should be reopened.

Activity icon
issue

Looky1173 issue godotengine/godot-proposals

Looky1173
Looky1173

Add the ability to drag and drop text in the script editor with the mouse

Describe the project you are working on

This feature is not tied to a particular/specific use case of the Godot engine as it would benefit all users who make use of the built-in script editor.

Describe the problem or limitation you are having in your project

To rearrange text in the script editor one has to select it, copy it, move the cursor to the desired location, and finally paste it. This can become quite cumbersome to do especially for people who are limited to (primarely) using one hand to navigate the editor/engine.

Plus there are users, like me, who only have 1 fully working hand, so we try and minimize the need to swap between mouse and keyboard as doing that is slow.

The quote above is from this proposal that has been closed as this repository became the centralized way to propose Godot features/enhancements, and hasn't been reopened since. This shows that this problem concerns accessibility too and should be seriously considered.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

To overcome the problem above, a feature that allows users to select, drag, and drop text withing the editor should be added. It is a standard feature present in most text editors therefore it would benefit all users. Furthermore, such a feature would enhance the core experience of the built-in script editor and would make the Godot engine more accessible.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Here is a GIF from the original closed issue that demonstrates this feature: peek 2018-03-31 09-19

If this enhancement will not be used often, can it be worked around with a few lines of script?

This would be a core feature of the Godot engine and, as far as I'm aware, cannot be worked arround. Besides, it most likely would be used on a regular basis by the majority of users who use the built-in script editor.

Is there a reason why this should be core and not an add-on in the asset library?

This feature is about improving the usability and accessibility of the built-in script editor, thus it should be core.

Oct
26
2 months ago
started
started time in 2 months ago
started
started time in 2 months ago
Oct
25
2 months ago